Repository navigation
nvmeofgw: stretched cluster fix relocate - #69490
Conversation
baum
left a comment
There was a problem hiding this comment.
The fix is sound, however before merge maybe worth fixing clear reloc_list per location iteration, see comment above
| if (state.location == location) { | ||
| num_gw_in_location ++; | ||
| if (state.availability != gw_availability_t::GW_AVAILABLE) { | ||
| reloc_list.push_back(state.ana_grp_id); |
There was a problem hiding this comment.
reloc_list is declared once outside the location loop but filled inside it without clearing.
If more than one location is processed in a tick (before the new early return), later locations inherit ANA groups from earlier ones and may relocate incorrectly.
Should we reloc_list.clear() at the start of each location iteration (or declare it inside the loop)?
There was a problem hiding this comment.
@baum , thanks will fix
but now with early return it should work because relocate list is per location and I return after first non empty list processed
f3b6841 to
41396ac
Compare
rzarzynski
left a comment
There was a problem hiding this comment.
Basically LGTM with some nits.
| @@ -818,7 +817,9 @@ void NVMeofGwMap::handle_abandoned_ana_groups(bool& propose) | |||
|
|
|||
| void NVMeofGwMap::check_relocate_ana_groups(const NvmeGroupKey& group_key, | |||
There was a problem hiding this comment.
The commit title / PR description uses the word "fix'. However, there is no reference (the Fixes: tag) to the bug tracker. Do you want to backport the commit? If yes, then the ticket is a must-have.
| for (auto& state_it: state.sm_state) { | ||
| if (state_it.second == gw_states_per_group_t::GW_ACTIVE_STATE) { | ||
| num_active_ana_in_location ++; | ||
| for (auto& gw_state : gws_states) // build locations set |
| if (state_it.second == gw_states_per_group_t::GW_ACTIVE_STATE) { | ||
| num_active_ana_in_location ++; | ||
| for (auto& gw_state : gws_states) // build locations set | ||
| locations_set.insert(gw_state.second.location); |
There was a problem hiding this comment.
I understand this step as "location dedup" as:
using NvmeGwMonStates = std::map<NvmeGwId, NvmeGwMonState>;location there is just std::string.
| if ((disaster && cleanup_in_process) || (!disaster)) { | ||
| uint32_t num_gw_in_location = 0; | ||
| uint32_t num_active_ana_in_location = 0; | ||
| for (auto& gw_state : gws_states) { // loop for GWs inside group-key |
There was a problem hiding this comment.
This nested looping theoretically increases the complexity (first we go through location from gws_states, then for every extracted location, we do reverse lookup) and seems suboptimal.
I assume the expected number of gateways (and thus gws_states) is small and there is no business in (over)optimizing.
There was a problem hiding this comment.
@rzarzynski, This is a background activity called in a tick(), currently we support only 8 GWs in pool group, 3 locations may be set
| for (auto& gw_state : gws_states) { // loop for GWs inside group-key | ||
| NvmeGwMonState& state = gw_state.second; | ||
| if (state.location == location) { | ||
| num_gw_in_location ++; |
There was a problem hiding this comment.
nit:
| num_gw_in_location ++; | |
| num_gw_in_location++; |
| auto& gws_states = created_gws[group_key]; | ||
| gws_states[failover_gw_id].sm_state[grpid] = | ||
| gw_states_per_group_t::GW_WAIT_FAILBACK_PREPARED; | ||
| start_timer(failover_gw_id, group_key, grpid, 3); |
There was a problem hiding this comment.
nit: I know it's not a new code but what does 3 mean here (magic number)?
There was a problem hiding this comment.
@rzarzynski , thanks it should be fixed , it is a value of failback preparation timer
| @@ -1362,6 +1359,21 @@ void NVMeofGwMap::fsm_handle_gw_delete( | |||
| } | |||
| } | |||
|
|
|||
| void NVMeofGwMap::fsm_handle_failback_and_relocation( | |||
There was a problem hiding this comment.
I like it dedups the code; next time please differentiate code shuffling from other changes (makes reviews easier).
fixes: https://tracker.ceph.com/issues/77803 Signed-off-by: Leonid Chernin <[email protected]>
41396ac to
4770952
Compare
bill-scales
left a comment
There was a problem hiding this comment.
Couple of minor comments, but change looks ok
| << " relocate to " << location << dendl; | ||
| relocate_ana_grp(gw_state.first, group_key, anagrp, | ||
| location, propose); | ||
| return; // allow just 1 relocation during a tick() |
There was a problem hiding this comment.
There are scenarios where relocate_ana_grp can return without doing a relocation (propose will remain set to false). Are these just transition states that will be resolved by a later tick, or are there scenarios where one ana grp is unable to relocate and could block other gw;s from relocating?
There was a problem hiding this comment.
nit: Not new code, but this logic can only result in min_num_ana_groups_in_gw being set to MAX_NUM_ANA_GROUPS_FOR_RELOCATE or 1. Other values are not possible. If this is intended behavior then you could use a boolean instead.
Fix ANA relocation procedure - need to perform relocation not only when disaster location is in cleanup state
but also when location is healthy.
https://tracker.ceph.com/issues/77803
Contribution Guidelines
To sign and title your commits, please refer to Submitting Patches to Ceph.
If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.
When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an
xbetween the brackets:[x]. Spaces and capitalization matter when checking off items this way.Checklist
Show available Jenkins commands
jenkins test classic perfJenkins Job | Jenkins Job Definitionjenkins test crimson perfJenkins Job | Jenkins Job Definitionjenkins test signedJenkins Job | Jenkins Job Definitionjenkins test make checkJenkins Job | Jenkins Job Definitionjenkins test make check arm64Jenkins Job | Jenkins Job Definitionjenkins test submodulesJenkins Job | Jenkins Job Definitionjenkins test dashboardJenkins Job | Jenkins Job Definitionjenkins test dashboard cephadmJenkins Job | Jenkins Job Definitionjenkins test apiJenkins Job | Jenkins Job Definitionjenkins test docsReadTheDocs | Github Workflow Definitionjenkins test ceph-volume allJenkins Jobs | Jenkins Jobs Definitionjenkins test windowsJenkins Job | Jenkins Job Definitionjenkins test rook e2eJenkins Job | Jenkins Job DefinitionYou must only issue one Jenkins command per-comment. Jenkins does not understand
comments with more than one command.