New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
librbd: optionally unregister "laggy" journal clients #10378
Conversation
@trociny Instead of unregistering the laggy client (which would work), I put a placeholder The rbd-mirror daemon can then detect if and when it's client state is set to DISCONNECTED, stop replay (if in-progress), and re-initiate an image sync w/o the need to split-brain. The sync point record supports a "from snapshot" so it can be modified to only resync from the last known good snapshot (if any). For example, if the system gets disconnected during the initial sync, it can recover w/o starting over from scratch by reconnecting to the journal, creating a second sync point record tied to the first, and once the first sync is complete, it would start with the second (similar to how VM/storage live migration transfers the full base, and then one or more deltas until it can cut over). The iterative / recoverable image sync wouldn't be part of this effort, but I wanted to lay out my full plans. [1] https://github.com/ceph/ceph/blob/master/src/cls/journal/cls_journal_types.h#L79 |
@dillaman Got it! Thanks. Will redo. |
6f922c7
to
8799931
Compare
@dillaman How do you like this version? |
@@ -1250,6 +1250,7 @@ OPTION(rbd_journal_object_flush_interval, OPT_INT, 0) // maximum number of pendi | |||
OPTION(rbd_journal_object_flush_bytes, OPT_INT, 0) // maximum number of pending bytes per journal object | |||
OPTION(rbd_journal_object_flush_age, OPT_DOUBLE, 0) // maximum age (in seconds) for pending commits | |||
OPTION(rbd_journal_pool, OPT_STR, "") // pool for journal objects | |||
OPTION(rbd_journal_client_object_sets_behind_max, OPT_INT, 0) // maximum number of object sets a journal client can be behind before it is automatically unregistered |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: perhaps rbd_journal_max_concurrent_object_sets
?
@trociny Looking good to me. The only missing piece is the smarts in |
@dillaman Updated, still not tested well. Also there are potential issues to discuss:
|
Added some tests. Also, experimental |
const std::string &client_id = c.id; | ||
uint64_t object_set = 0; | ||
if (!c.commit_position.object_positions.empty()) { | ||
auto position = *(c.commit_position.object_positions.begin()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: auto &
@@ -986,6 +993,7 @@ void JournalMetadata::committed(uint64_t commit_tid, | |||
|
|||
ldout(m_cct, 20) << "updated commit position: " << commit_position << ", " | |||
<< "on_safe=" << m_commit_position_ctx << dendl; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: remove empty line
@dillaman updated. Now when a journal client is disconnected, rbd-mirror just stops image replayer, until 'mirror image resync' command is issued by user. Also rbd_mirror_resync_after_disconnect configuration option is added to automatically start the resync. |
@@ -985,6 +1084,11 @@ Shell::Action action_import( | |||
{"journal", "import"}, {}, "Import image journal.", "", | |||
&get_import_arguments, &execute_import); | |||
|
|||
Shell::Action action_disconnect( | |||
{"journal", "client", "disconnect"}, {}, | |||
"Flag image journal client disconnected.", "", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: "... as disconnected"
|
||
if (client.state != cls::journal::CLIENT_STATE_CONNECTED) { | ||
dout(0) << "client flagged disconnected, stopping image replay" << dendl; | ||
stop(nullptr, false, "disconnected"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same comment here: should we set an error code so that an admin can see the problem?
@trociny few minor comments, but otherwise lgtm |
@dillaman Updated. I think I addressed all your comments. The only thing is renaming |
@trociny That's fine with me -- just wanted to ensure it didn't overlap with "rbd_mirror". |
d827361
to
066b516
Compare
@trociny rebase required |
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Fixes: http://tracker.ceph.com/issues/14738 Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
…cceeded Signed-off-by: Mykola Golub <mgolub@mirantis.com>
Signed-off-by: Mykola Golub <mgolub@mirantis.com>
…nnect Signed-off-by: Mykola Golub <mgolub@mirantis.com>
@dillaman Testing after rebase I noticed the issue with I have updated handle_remote_journal_metadata_updated to check the current ImageReplayer state and return if it is not running. Now, retesting this locally. I will let you know about test results. |
@dillaman it passed local tests |
Fixes: http://tracker.ceph.com/issues/14738