rbd-mirror: integration of the new GroupSnapshotNamespaceMirror::complete field#65164
Conversation
3f69b1e to
35416e5
Compare
35416e5 to
cd8f7d5
Compare
cd8f7d5 to
80781da
Compare
80781da to
d6cb9bf
Compare
|
Not yet tested with |
a5f9f89 to
496493f
Compare
|
http://141.125.111.75:8080/job/rbd_group_snap_mirror_tests_suite_run/418/console |
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
496493f to
6d6cf38
Compare
6d6cf38 to
aa6ce75
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
aa6ce75 to
6fb682f
Compare
6fb682f to
84f37a7
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
c384668 to
29de685
Compare
Got it. I see that we're trying to match what's done for mirror image snapshots. Referred |
|
Naming suggestions for methods in group_replayer/Replayer.cc
With the above suggestion, we can subtly get the idea that the function is generating a group snapshot in CREATING state. The current naming just tells me that the group snapshot is created without indicating that the snapshot is in CREATING state.
The previous naming of the above methods was misleading. The methods weren't executing steps after (post) a mirror or user snapshot was complete. They were actually trying to set a mirror or user snapshot to a complete if the snapshot met the requirements. With the changes in the PR, we set the state of mirror snapshot to CREATED if the requirements are met. And then I'd break up the handle_post_mirror_snapshot_complete(). It'd call complete_miror_snapshot() that has a callback handle_complete_mirror_snapshot(), which is currently named handle_mirror_snapshot_complete_field() . So something like, @VinayBhaskar-V what do you think? |
I would keep the naming changes into a separate commit, as they seem a bit out of the context to the subject of the PR here, but if we are touching them anyway and @VinayBhaskar-V is fine applying it here, I have some suggestions:
while these sounds odd to me, and I would stick to the existing.
I see Raman's valid point, how about just
.. and if we really want a split for the later routine, we can then name it |
I agree with prasanna here
instead of this how about having something like
I agree with ramana for this. |
29de685 to
31c4fb2
Compare
31c4fb2 to
90a4f70
Compare
af0c293 to
8041e4e
Compare
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
90a4f70 to
d297b0b
Compare
d297b0b to
570b435
Compare
791e94b to
c941c74
Compare
c941c74 to
6098bbb
Compare
…lete field This commit introduces the new field **complete**, of type **MirrorGroupSnapshotCompleteState** enum, to the GroupSnapshotNamespaceMirror structure. This change is necessary to align behavior of mirror group snapshots with that of mirror image snapshots, allowing for a precise differentiation between a group snapshot that has been created and one that has been fully synced. **1. Handling Old-Style Snapshots** Decoding Old Snapshots: The original GroupSnapshotNamespaceMirror structure lacked the complete field, which implicitly defaulted to a bool value of false upon initialization. When an old snapshot (lacking the complete field) is decoded by an upgraded client, the implicit default value maps to MIRROR_GROUP_SNAPSHOT_COMPLETE_IF_CREATED. Completion Check: A snapshot is determined old by checking it's complete filed i.e complete == MIRROR_GROUP_SNAPSHOT_COMPLETE_IF_CREATED and if it's old the sync completion for these group snapshots is determined by checking the state field i.e state == GROUP_SNAPSHOT_STATE_CREATED. During a upgrade where **OSDs have not yet been updated**, the new client will be forced to create snapshots using the old style. These snapshots will be initialized with MIRROR_GROUP_SNAPSHOT_COMPLETE_IF_CREATED and will stay on that to prevent immediate, incorrect cleanup by the old OSDs and in this case state field is set to **GROUP_SNAPSHOT_STATE_CREATED** only after snapshot completed it's sync. **2. Handling New-Style Snapshots** New snapshots are initialized with complete == **MIRROR_GROUP_SNAPSHOT_INCOMPLETE**, state == GROUP_SNAPSHOT_STATE_CREATING. The group snapshot's state is marked as GROUP_SNAPSHOT_STATE_CREATED as soon as its metadata is fully available and stored. Completion Check: The snapshot's sync is confirmed only when complete == MIRROR_GROUP_SNAPSHOT_COMPLETE along with state check (state == GROUP_SNAPSHOT_STATE_CREATED) is satisfied. This approach ensures seamless transition and compatibility, allowing the system to correctly interpret the synchronization status of both old and newly created group snapshots. Signed-off-by: VinayBhaskar-V <vvarada@redhat.com>
6098bbb to
5bbdbed
Compare
pkalever
left a comment
There was a problem hiding this comment.
Looks good to me.
It will be nice to validate the pruning of group snapshots manually with the PR as we don't have tests coverage there.
@pkalever shared offline:
|
This commit introduces the new field complete, of type MirrorGroupSnapshotCompleteState enum,
to the GroupSnapshotNamespaceMirror structure. This change is necessary to align behavior of
mirror group snapshots with that of mirror image snapshots, allowing for a precise differentiation
between a group snapshot that has been created and one that has been fully synced.
1. Handling Old-Style Snapshots
Decoding Old Snapshots: The original GroupSnapshotNamespaceMirror structure lacked the complete field,
which implicitly defaulted to a bool value of false upon initialization.
When an old snapshot (lacking the complete field) is decoded by an upgraded client,
the implicit default value maps to MIRROR_GROUP_SNAPSHOT_COMPLETE_IF_CREATED.
Completion Check: A snapshot is determined old by checking it's complete filed i.e
complete == MIRROR_GROUP_SNAPSHOT_COMPLETE_IF_CREATED and if it's old the sync completion for these group snapshots is determined by checking the state field i.e state == GROUP_SNAPSHOT_STATE_CREATED.
During a upgrade where OSDs have not yet been updated, the new client will be forced to create snapshots using the old style.
These snapshots will be initialized with MIRROR_GROUP_SNAPSHOT_COMPLETE_IF_CREATED and will stay on that
to prevent immediate, incorrect cleanup by the old OSDs and in this case state field is set to GROUP_SNAPSHOT_STATE_CREATED
only after snapshot completed it's sync.
2. Handling New-Style Snapshots
New snapshots are initialized with complete == MIRROR_GROUP_SNAPSHOT_INCOMPLETE, state == GROUP_SNAPSHOT_STATE_CREATING
The group snapshot's state is marked as GROUP_SNAPSHOT_STATE_CREATED as soon as its metadata is fully available and stored.
Completion Check: The snapshot's sync is confirmed only when complete == MIRROR_GROUP_SNAPSHOT_COMPLETE
along with state check (state == GROUP_SNAPSHOT_STATE_CREATED) is satisfied.
This approach ensures seamless transition and compatibility, allowing the system to correctly interpret the
synchronization status of both old and newly created group snapshots.
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 Definition