Skip to content

Commit

Permalink
DAOS-16927 pool: Fix upgrade DER_NOTSUPPORTEDs
Browse files Browse the repository at this point in the history
If a pool upgrade encounters an error in pool_upgrade_props, the
upgrade global version remains at the old global version, while the
upgrade status changes to FAILED. In this state, a repeated pool
upgrade will fail with the following error in the PS leader engine
log:

  ds_pool_upgrade_if_needed() b377db55: upgrading pool 3 -> 4 is
    unsupported because pool upgraded to 3 last time failed

This patch implements a quick fix that ensures the upgrade global
version is updated to the new global version when the upgrade status
changes to FAILED, so that a repeated upgrade command will attempt to
upgrade the pool again.

Signed-off-by: Li Wei <[email protected]>
Required-githooks: true
  • Loading branch information
liw committed Feb 10, 2025
1 parent 8fe77b9 commit 825805d
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions src/pool/srv_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -5966,7 +5966,7 @@ __ds_pool_mark_upgrade_completed(uuid_t pool_uuid, struct pool_svc *svc, int rc)
struct rdb_tx tx;
d_iov_t value;
uint32_t upgrade_status;
uint32_t global_version;
uint32_t global_version = DAOS_POOL_GLOBAL_VERSION;
uint32_t obj_version;
int rc1;
daos_prop_t *prop = NULL;
Expand All @@ -5987,12 +5987,25 @@ __ds_pool_mark_upgrade_completed(uuid_t pool_uuid, struct pool_svc *svc, int rc)
if (rc1)
D_GOTO(out_tx, rc1);

if (rc != 0) {
/*
* Currently, the upgrade global version may have not been updated yet, if
* pool_upgrade_props has encountered an error.
*/
d_iov_set(&value, &global_version, sizeof(global_version));
rc1 = rdb_tx_update(&tx, &svc->ps_root, &ds_pool_prop_upgrade_global_version,
&value);
if (rc1) {
DL_ERROR(rc1, "failed to write upgrade global version prop");
D_GOTO(out_tx, rc1);
}
}

/*
* only bump global version and connectable properties
* if upgrade succeed.
*/
if (rc == 0) {
global_version = DAOS_POOL_GLOBAL_VERSION;
d_iov_set(&value, &global_version, sizeof(global_version));
rc1 = rdb_tx_update(&tx, &svc->ps_root,
&ds_pool_prop_global_version, &value);
Expand Down

0 comments on commit 825805d

Please sign in to comment.