Repository navigation
test/osd: recreate corrupt last complete resulting in cloning of non-existing object - #71526
Conversation
bill-scales
left a comment
There was a problem hiding this comment.
New test cases are fine. I'm a bit worried about the maintainability of some of the test harness changes - in particular I don't think split PGs will function correctly much beyond the split.
The split capability is limited to a single split and only from 1 to 2 PGs. This should be sufficient (I don't think there are any scenarios that can only be covered by performing multiple splits or an N-way split) but could do with a comment and an assert to police this.
| child_pgid = pg_t(1, pool_id); // seed 1 = child of seed 0 for pg_num 1 -> 2 | ||
| child_split_bits = split_bits; | ||
|
|
||
| std::vector<int> acting; |
There was a problem hiding this comment.
You are resetting the up map for both the parent and child PGs here. I think you should be keeping the current acting set for the parent and setting the child to start with the same acting set. Once the split has occurred you could then optionally change the up map for the child (although I'm not convinced that the harness really copes with the parent and child having different up maps at the moment - in particular if the child is using different OSDs to the parent).
There was a problem hiding this comment.
Resolved in my latest commit.
|
|
||
| // Child-PG state populated by split_pg(). Empty until a split is performed. | ||
| pg_t child_pgid; | ||
| unsigned child_split_bits = 0; |
There was a problem hiding this comment.
I don't think child_split_bits needs to stored. It is written to by split_pg() and read by create_child_peering_state which is called by split_pg - it could just be passed as a function argument
There was a problem hiding this comment.
Resolved in my latest commit.
| pg_t child_pgid; | ||
| unsigned child_split_bits = 0; | ||
| bool stall_recovery_reservations = false; | ||
| std::map<int, std::unique_ptr<PeeringState>> child_peering_states; |
There was a problem hiding this comment.
Rather than having child_peering_{states, ctxs, listeners, dpps} it might be cleaner to change the maps for shard_peering_{states, ctxs, listeners, dpps} to use <osd,pg> instead of as the key.
You could keep simpler getters for now that find the parent/child version for now.
Keeping the child separate will cause problems if you try and run the test harness much beyond performing the split. For example if a new epoch occurs I don't think you are updating the epoch for the child_peering_listeners.
There was a problem hiding this comment.
Resolved in my latest commit.
| std::map<int, std::unique_ptr<PeeringCtx>> child_peering_ctxs; | ||
| std::map<int, std::unique_ptr<MockPeeringListener>> child_peering_listeners; | ||
| std::map<int, coll_t> child_colls; | ||
| std::map<int, ObjectStore::CollectionHandle> child_chs; |
There was a problem hiding this comment.
I don't think we should be storing child_colls and child_chs - you can get these from MockPeeringListener instead
There was a problem hiding this comment.
Resolved in my latest commit.
|
This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved |
77ba6c9 to
d1bae78
Compare
|
Latest update is a rebase only. I am working on comments. |
1a9e638 to
dde410e
Compare
dde410e to
98ea78e
Compare
…existing object Before this change the EC peering unit-test fixture could drive recovery and OSD failover, but had no way to reach the state behind tracker 68649: a primary that believes a still-missing shard is up to date and forwards a clone to it. Reaching that needs aggressive PG-log trimming, control over which child a PG split sends an object to, and an actual PG split - none of which the fixture could do. This adds that capability to ECPeeringTestFixture and friends: - Opt-in aggressive log trimming on the write path (it now computes a real trim_to / pg_committed_to via update_trim_to()/complete_write(), as PrimaryLogPG does) so a shard's log can be driven to the trimmed and empty states that a low osd_*_pg_log_entries produces in the field. - Per-object hash control, so an object can be steered into a chosen child PG when pg_num increases. - A real PG split (split_pg): it bumps pg_num, runs the production PeeringState::split_into, splits the ObjectStore collection, and peers the child PG - including the pg_temp cycle the child primary needs to finish peering. - Epoch-gated, correctly-routed delivery of deferred peering events in MockPeeringListener, matching PG::do_peering_event()/pg_has_reset_since: a deferred event (e.g. ActivateCommitted, DoRecovery) queued in a prior interval is now discarded rather than delivered into Reset, and is delivered to the listener's own PG (parent vs split child). Without this the fixture aborted once the fix let recovery actually run. Two tests are added. DivergentLogRewindThenSplit builds the corrupt state through the real code paths - trim to a high tail, an async-recovery target that rolls forward uncommitted EC writes, proc_replica_log's divergent rewind, then a real split - and asserts the gate PrimaryLogPG uses before issuing a clone (is_degraded_or_backfilling / should_send_op, both of which need peer_missing[target].is_missing). DivergentLogRewindThenNewInterval is a negative control: a plain interval change instead of a split does not reproduce it (the primary re-requests the target's log), showing the split is required. DivergentLogRewindThenSplit fails on this commit alone and passes once the following reset_complete_to fix is applied. Assisted-by: Claude:Claude-opus-4.8(1M) Assisted-by: IBM-Bob-v2.0.1 Signed-off-by: Alex Ainscow <[email protected]> # Conflicts: # src/test/osd/PGBackendTestFixture.h
98ea78e to
27a105a
Compare
test/osd: recreate corrupt last complete resulting in cloning of non-existing object Reviewed-by: Bill Scales <[email protected]>
Before this change the EC peering unit-test fixture could drive recovery
and OSD failover, but had no way to reach the state behind tracker 68649:
a primary that believes a still-missing shard is up to date and forwards
a clone to it. Reaching that needs aggressive PG-log trimming, control
over which child a PG split sends an object to, and an actual PG split -
none of which the fixture could do.
This adds that capability to ECPeeringTestFixture and friends:
real trim_to / pg_committed_to via update_trim_to()/complete_write(),
as PrimaryLogPG does) so a shard's log can be driven to the trimmed and
empty states that a low osd_*_pg_log_entries produces in the field.
child PG when pg_num increases.
PeeringState::split_into, splits the ObjectStore collection, and peers
the child PG - including the pg_temp cycle the child primary needs to
finish peering.
MockPeeringListener, matching PG::do_peering_event()/pg_has_reset_since:
a deferred event (e.g. ActivateCommitted, DoRecovery) queued in a prior
interval is now discarded rather than delivered into Reset, and is
delivered to the listener's own PG (parent vs split child). Without
this the fixture aborted once the fix let recovery actually run.
Two tests are added. DivergentLogRewindThenSplit builds the corrupt
state through the real code paths - trim to a high tail, an
async-recovery target that rolls forward uncommitted EC writes,
proc_replica_log's divergent rewind, then a real split - and asserts the
gate PrimaryLogPG uses before issuing a clone (is_degraded_or_backfilling
/ should_send_op, both of which need peer_missing[target].is_missing).
DivergentLogRewindThenNewInterval is a negative control: a plain interval
change instead of a split does not reproduce it (the primary re-requests
the target's log), showing the split is required.
DivergentLogRewindThenSplit fails on this commit alone and passes once
the following reset_complete_to fix is applied.
Assisted-by: Claude:Claude-opus-4.8(1M)
Assisted-by: IBM-Bob-v2.0.1
Signed-off-by: Alex Ainscow [email protected]
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.