Repository navigation
osd/PGLog: lower last_complete in reset_complete_to on an empty log - #71525
Conversation
reset_complete_to() returned early whenever the log was empty and never touched last_complete. Its callers rely on it to do the opposite: PeeringState::activate() (via activate_not_complete) and split_into() provisionally leave last_complete == last_update and delegate to reset_complete_to() the job of pulling it back below the oldest missing version. rewind_divergent_log() does the same - it only clamps last_complete down to the new (tail) head and adds the rewound objects to missing, expecting the later reset_complete_to() to lower it further. So when a shard's log was rewound to empty (proc_replica_log discarding divergent entries) or a split handed a child an empty log, and the missing set was non-empty, last_complete was left equal to last_update. pg_info_t::has_missing() is last_complete != last_update, so it reported "no missing"; GetMissing's identical-log fast-path then discarded the peer's missing set and the primary activated the shard as up to date. A subsequent clone was forwarded to that shard, which no longer had the object, and it crashed with ENOENT in BlueStore. Drop the empty-log early return and let the existing complete_to == log.begin() path handle it: for an empty log begin() == end(), so the oldest_need walk is skipped and last_complete is lowered below oldest_need just as in the non-empty case. complete_to is left at end(), which is the only valid position for an empty log - the consumers that read complete_to == end() as "recovery complete" already special-case an empty log. Assisted-by: Claude:Claude-Opus-4.8 Assisted-by: IBM Bob Signed-off-by: Alex Ainscow <[email protected]> Fixes: https://tracker.ceph.com/issues/68649
|
This PR has been added to wip-bharath12-testing-20260907.061609-main. |
bill-scales
left a comment
There was a problem hiding this comment.
Approve.
It is possible to have missing entries but no log entries. After a PG split is one possibility, but with very aggressive log trimming and a divergent log entry being rolled backwards (and creating a missing entry because the update has been completed and cannot be rolled back) is another.
The code depends on last_complete being set != last_update when there are missing entries. If we have an empty log we need to skip the first part of this function that scans the log, but still need the second half to set last complete to be prior to the oldest need.
|
This is an automated message by src/script/redmine-upkeep.py. I found one or more
The referenced tickets are: Those tickets do not reference this merged Pull Request. If this Pull Request merge resolves any of those tickets, please update the "Pull Request ID" field on each ticket. A future run of this script will appropriately update them. |
osd/PGLog: lower last_complete in reset_complete_to on an empty log Reviewed-by: Bill Scales <[email protected]>
reset_complete_to() returned early whenever the log was empty and never touched last_complete. Its callers rely on it to do the opposite: PeeringState::activate() (via activate_not_complete) and split_into() provisionally leave last_complete == last_update and delegate to reset_complete_to() the job of pulling it back below the oldest missing version. rewind_divergent_log() does the same - it only clamps last_complete down to the new (tail) head and adds the rewound objects to missing, expecting the later reset_complete_to() to lower it further.
So when a shard's log was rewound to empty (proc_replica_log discarding divergent entries) or a split handed a child an empty log, and the missing set was non-empty, last_complete was left equal to last_update. pg_info_t::has_missing() is last_complete != last_update, so it reported "no missing"; GetMissing's identical-log fast-path then discarded the peer's missing set and the primary activated the shard as up to date. A subsequent clone was forwarded to that shard, which no longer had the object, and it crashed with ENOENT in BlueStore (tracker 68649).
Drop the empty-log early return and let the existing complete_to == log.begin() path handle it: for an empty log begin() == end(), so the oldest_need walk is skipped and last_complete is lowered below oldest_need just as in the non-empty case. complete_to is left at end(), which is the only valid position for an empty log - the consumers that read complete_to == end() as "recovery complete" already special-case an empty log.
Recreate test harness (will never be backported):
#71526
This likely does not need backporting - as its low probability, but it IS a bug in tentacle/umbrella, so we might change our mind.
Assisted-by: Claude:Claude-Opus-4.8
Assisted-by: IBM Bob
Signed-off-by: Alex Ainscow [email protected]
Fixes: https://tracker.ceph.com/issues/68649
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.