From 57eb811bb1b684b12f1393f298b09e6f6175e385 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Tue, 2 Jan 2024 00:50:23 +0300 Subject: [PATCH] Do not die on invalid pool configurations --- mon/mon.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/mon/mon.js b/mon/mon.js index a6f9d547..a9b3fcf9 100644 --- a/mon/mon.js +++ b/mon/mon.js @@ -1349,8 +1349,8 @@ class Mon // Something has changed console.log('Pool configuration or OSD tree changed, re-optimizing'); // First re-optimize PGs, but don't look at history yet - const optimize_results = await Promise.all(Object.keys(this.state.config.pools) - .map(pool_id => this.generate_pool_pgs(pool_id, osd_tree, levels))); + const optimize_results = (await Promise.all(Object.keys(this.state.config.pools) + .map(pool_id => this.generate_pool_pgs(pool_id, osd_tree, levels)))).filter(r => r); // Then apply the modification in the form of an optimistic transaction, // each time considering new pg/history modifications (OSDs modify it during rebalance) while (!await this.apply_pool_pgs(optimize_results, up_osds, osd_tree, tree_hash)) @@ -1436,6 +1436,10 @@ class Mon async apply_pool_pgs(results, up_osds, osd_tree, tree_hash) { + if (!results.length) + { + return true; + } for (const pool_id in (this.state.config.pgs||{}).items||{}) { // We should stop all PGs when deleting a pool or changing its PG count