Repository navigation
nvmeofgw:fix forcing unavalable gw exit by sending - #68650
Conversation
bill-scales
left a comment
There was a problem hiding this comment.
Can you give a bit more explanation of the change on lines 1118-1122 of NVMeofGwMon.cc. I get that you need to transition out of GW_UNAVAILABLE when the GW returns, otherwise we will continue to send the GW empty maps, but why is it safe to transition to GW_CREATED?
Am I right in thinking that this is safe because the next state transition to GW_AVAILABLE/GW_STANDBY will happen in NVMeofGwMap::process_gw_map_ka and that this function treats GW_CREATED and GW_UNAVAILABLE exactly the same
| gw_created.availability == gw_availability_t::GW_UNAVAILABLE) { | ||
| dout (4) << "GW " << gw_id << " Send empty unicast map in state " | ||
| << gw_created.availability << dendl; | ||
| continue; |
There was a problem hiding this comment.
ACK: While a gateway is GW_UNAVAILABLE make sure it doesn't get included in the gateway map
There was a problem hiding this comment.
right, I need transition out of GW_UNAVAILABLE when the GW returns, otherwise we will continue to send the GW empty maps and it keep reset . We need send empty map when it becomes Unavailable, not from the beginning of its life . I think transition to Created is safe. I added the code on lines 1118-1122 during debug
| gw_availability_t::GW_UNAVAILABLE) { | ||
| pending_map.created_gws[group_key][gw_id].availability = | ||
| gw_availability_t::GW_CREATED; // prevent sending empty map to this GW after restart | ||
| } |
There was a problem hiding this comment.
ACK: When the gateway returns we have to move it out of the GW_UNAVAILABLE state otherwise we won't add it to the map. The GW_CREATED state (I think this represents a newly created but not yet available GW) is a suitable choice, I think we then transition to GW_AVAILABLE/GW_STANDBY in process_gw_map_ka??
| @@ -1149,11 +1154,9 @@ bool NVMeofGwMon::prepare_beacon(MonOpRequestRef op) | |||
| false) && | |||
| (avail == gw_availability_t::GW_AVAILABLE || | |||
| avail == gw_availability_t::GW_UNAVAILABLE )) { | |||
| ack_map.created_gws[group_key][gw_id] = | |||
| pending_map.created_gws[group_key][gw_id]; | |||
There was a problem hiding this comment.
I don't think it is necessary to delete this as the modification in NVMeofGwMap::to_gmap will ensure that this gets filtered out of the map sent in the reply message, but given that we know that is going to happen it doesn't harm not to add it to ack_map
There was a problem hiding this comment.
@bill-scales , map to the GWs is sent in two ways :
1 . unicast map in NVMeofGwMap::to_gmap (per update_from_paxos)
2. map response do_send_map_ack . we need it as GW MonClient uses maps as keep alive. it exits if does not receive map in 100 sec.
So If I want gw exits immediately I have to send it empty map as response and not wait for new paxos epoch
bill-scales
left a comment
There was a problem hiding this comment.
Ok, happy with the changes
|
jenkins make check arm64 |
rzarzynski
left a comment
There was a problem hiding this comment.
LGTM with a tiny little nit: there is the typo ("unavalable") in the commit title.
empty map to it Signed-off-by: Leonid Chernin <[email protected]>
e23ac9c to
8e32fff
Compare
|
@rzarzynski , thanks , corrected the title |
In some cases when monitor detects that GW is out of sync with it, need to force GW exit and restart.
Example is scenario when GW is marked unavailable in the database of monitor due to detected beacon timeout but GW continues sending beacons marking itself being in Available state (first beacon from the GW after startup sent in Created state by the protocol rules)
The agreed way to cause GW exit is that monitor sends UNAVAILABLE state to it in the map. But this not always works we need more reliable solution.
So this PR forces unavailable gw exit by sending empty map to it. In the previous implementation the map with unavailable state was sent but it does not guarantee GW exit because GW mon client always compares maps - if map did not change it just ignored. Empty map with just epoch in it for sure differs from the previously stored map, so GW would exit
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.