Repository navigation
osd: pwlc was able to retain values larger than the last_update - #71579
Merged
ljflores merged 1 commit intoSep 23, 2026
Merged
Conversation
JonBailey1993
marked this pull request as draft
September 7, 2026 10:52
JonBailey1993
force-pushed
the
pwlc_ahead_of_last_update_assert
branch
from
September 7, 2026 10:54
5fa0c51 to
1bd3e0b
Compare
Contributor
Author
|
jenkins test windows |
JonBailey1993
marked this pull request as ready for review
September 8, 2026 09:03
bill-scales
reviewed
Sep 8, 2026
bill-scales
left a comment
Contributor
There was a problem hiding this comment.
Genearlly ok, minor additional check required to ensure that the start of the range is not greater than the end of the range.
In certain scenarios during peering, it was possible for us to tell other nodes they needed to roll back their last update when we have divergent entries. We do not modify the pwlc when we rollback the last_update, but we do potentially update our own pwlc from the peers pwlc in this process, meaning we have a pwlc with a newer version in it than the agreed upon latest update. This can then be propogated out to non-primary shards causing each of those shards to assert. Signed-off-by: Jon Bailey <[email protected]> Assisted-by: IBM Bob 2.1.0
JonBailey1993
force-pushed
the
pwlc_ahead_of_last_update_assert
branch
from
September 9, 2026 08:47
1bd3e0b to
a0e23ce
Compare
Contributor
|
This PR has been added to wip-bharath25-testing-20260918.001212-main. |
Contributor
This was referenced Sep 29, 2026
5 of 14 tasks
4 of 14 tasks
aainscow
added a commit
to aainscow/ceph
that referenced
this pull request
Oct 1, 2026
In an optimized EC pool, a sub-stripe write gives the shards it does not touch a partial_writes_last_complete (pwlc) range ending at that write. If peering later rolls the write back, a pwlc range that still ends at it is stale, and applying it moves a nonprimary shard's last_update and log head to a version that no longer exists. ceph#71579 ("osd: pwlc was able to retain values larger than the last_update") trims the pwlc copies the primary holds for divergent peers in proc_replica_log, but the primary's own copy is not trimmed. The new primary merges each peer's pwlc in update_peer_info() during GetInfo, before GetLog has decided the authoritative log, so it keeps a range ending at a write that peering then rolls back. proc_master_log() would trim it, but does not run when the primary is its own log source. activate() then stamps the stale range with a new epoch, making it the definitive copy, and sends it to the peers. The nonprimary shards apply it and move their last_update and log head to the rolled-back version, so the next write to them, which reuses that version number, asserts in IndexedLog::add; a shard left with such a last_update can also be picked later as the log source and then never be recovered. The primary's log is authoritative once it activates, so no pwlc range may end past its head. activate() now trims pwlc to the head before stamping the epoch, which also covers ranges merged after GetLog in WaitUpThru and from peers whose log head already matched. A nonprimary shard keeps its own pwlc too, and update_peer_info() applies its own range after merging only the ranges the primary sends. When no primary-capable shard of the new interval saw a partial write that skipped it, the primary sends no range for it, so the shard applies its stale range again right after the primary's MInfoRec has rewound its log. update_peer_info() now trims a nonprimary shard's pwlc to the primary's last_update before applying it. The range for its own shard that a replica applies from an MLogRec before merging the log is capped at the sender's last_update the same way. With the activate() change a primary no longer sends such a range; the cap is defensive, for mixed-version clusters during an upgrade where the primary still runs older code. Tested by TestECFailoverWithPeering.RolledBackPeeredWriteLeavesNoStalePwlc and RolledBackPeeredWriteLeavesNoStaleReplicaPwlc in the following commit. Fixes: https://tracker.ceph.com/issues/81283 Assisted-by: Claude Code
aainscow
added a commit
to aainscow/ceph
that referenced
this pull request
Oct 6, 2026
In an optimized EC pool, a sub-stripe write gives the shards it does not touch a partial_writes_last_complete (pwlc) range ending at that write. If peering later rolls the write back, a pwlc range that still ends at it is stale, and applying it moves a nonprimary shard's last_update and log head to a version that no longer exists. ceph#71579 ("osd: pwlc was able to retain values larger than the last_update") trims the pwlc copies the primary holds for divergent peers in proc_replica_log, but the primary's own copy is not trimmed. The new primary merges each peer's pwlc in update_peer_info() during GetInfo, before GetLog has decided the authoritative log, so it keeps a range ending at a write that peering then rolls back. proc_master_log() would trim it, but does not run when the primary is its own log source. activate() then stamps the stale range with a new epoch, making it the definitive copy, and sends it to the peers. The nonprimary shards apply it and move their last_update and log head to the rolled-back version, so the next write to them, which reuses that version number, asserts in IndexedLog::add; a shard left with such a last_update can also be picked later as the log source and then never be recovered. The primary's log is authoritative once it activates, so no pwlc range may end past its head. activate() now trims pwlc to the head before stamping the epoch, which also covers ranges merged after GetLog in WaitUpThru and from peers whose log head already matched. A nonprimary shard keeps its own pwlc too, and update_peer_info() applies its own range after merging only the ranges the primary sends. When no primary-capable shard of the new interval saw a partial write that skipped it, the primary sends no range for it, so the shard applies its stale range again right after the primary's MInfoRec has rewound its log. update_peer_info() now trims a nonprimary shard's pwlc to the primary's last_update before applying it. The range for its own shard that a replica applies from an MLogRec before merging the log is capped at the sender's last_update the same way. With the activate() change a primary no longer sends such a range; the cap is defensive, for mixed-version clusters during an upgrade where the primary still runs older code. Tested by TestECFailoverWithPeering.RolledBackPeeredWriteLeavesNoStalePwlc and RolledBackPeeredWriteLeavesNoStaleReplicaPwlc in the following commit. Fixes: https://tracker.ceph.com/issues/81283 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]>
aainscow
added a commit
to aainscow/ceph
that referenced
this pull request
Oct 8, 2026
In an optimized EC pool, a sub-stripe write gives the shards it does not touch a partial_writes_last_complete (pwlc) range ending at that write. If peering later rolls the write back, a pwlc range that still ends at it is stale, and applying it moves a nonprimary shard's last_update and log head to a version that no longer exists. ceph#71579 ("osd: pwlc was able to retain values larger than the last_update") trims the pwlc copies the primary holds for divergent peers in proc_replica_log, but the primary's own copy is not trimmed. The new primary merges each peer's pwlc in update_peer_info() during GetInfo, before GetLog has decided the authoritative log, so it keeps a range ending at a write that peering then rolls back. proc_master_log() would trim it, but does not run when the primary is its own log source. activate() then stamps the stale range with a new epoch, making it the definitive copy, and sends it to the peers. The nonprimary shards apply it and move their last_update and log head to the rolled-back version, so the next write to them, which reuses that version number, asserts in IndexedLog::add; a shard left with such a last_update can also be picked later as the log source and then never be recovered. The primary's log is authoritative once it activates, so no pwlc range may end past its head. activate() now trims pwlc to the head before stamping the epoch, which also covers ranges merged after GetLog in WaitUpThru and from peers whose log head already matched. A nonprimary shard keeps its own pwlc too, and update_peer_info() applies its own range after merging only the ranges the primary sends. When no primary-capable shard of the new interval saw a partial write that skipped it, the primary sends no range for it, so the shard applies its stale range again right after the primary's MInfoRec has rewound its log. update_peer_info() now trims a nonprimary shard's pwlc to the primary's last_update before applying it. The range for its own shard that a replica applies from an MLogRec before merging the log is capped at the sender's last_update the same way. With the activate() change a primary no longer sends such a range; the cap is defensive, for mixed-version clusters during an upgrade where the primary still runs older code. Tested by TestECFailoverWithPeering.RolledBackPeeredWriteLeavesNoStalePwlc and RolledBackPeeredWriteLeavesNoStaleReplicaPwlc in the following commit. Fixes: https://tracker.ceph.com/issues/81283 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]> (cherry picked from commit 5251dff)
aainscow
added a commit
to aainscow/ceph
that referenced
this pull request
Oct 14, 2026
… activates In an optimized EC pool, a sub-stripe write gives the shards it does not touch a partial_writes_last_complete (pwlc) range ending at that write. If peering later rolls the write back, a pwlc range that still ends at it is stale, and applying it moves a nonprimary shard's last_update and log head to a version that no longer exists. ceph#71579 ("osd: pwlc was able to retain values larger than the last_update") trims the pwlc copies the primary holds for divergent peers in proc_replica_log, but the primary's own copy is not trimmed. The new primary merges each peer's pwlc in update_peer_info() during GetInfo, before GetLog has decided the authoritative log, so it keeps a range ending at a write that peering then rolls back. proc_master_log() would trim it, but does not run when the primary is its own log source. activate() then stamps the stale range with a new epoch, making it the definitive copy, and sends it to the peers. The nonprimary shards apply it and move their last_update and log head to the rolled-back version, so the next write to them, which reuses that version number, asserts in IndexedLog::add; a shard left with such a last_update can also be picked later as the log source and then never be recovered. The primary's log is authoritative once it activates, so no pwlc range may end past its head. activate() now trims pwlc to the head before stamping the epoch, which also covers ranges merged after GetLog in WaitUpThru and from peers whose log head already matched. A nonprimary shard keeps its own pwlc too, and update_peer_info() applies its own range after merging only the ranges the primary sends. When no primary-capable shard of the new interval saw a partial write that skipped it, the primary sends no range for it, so the shard applies its stale range again right after the primary's MInfoRec has rewound its log. update_peer_info() now trims a nonprimary shard's pwlc to the primary's last_update before applying it. The range for its own shard that a replica applies from an MLogRec before merging the log is capped at the sender's last_update the same way. With the activate() change a primary no longer sends such a range; the cap is defensive, for mixed-version clusters during an upgrade where the primary still runs older code. Tested by TestECFailoverWithPeering.RolledBackPeeredWriteLeavesNoStalePwlc and RolledBackPeeredWriteLeavesNoStaleReplicaPwlc in the following commit. Fixes: https://tracker.ceph.com/issues/81283 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]> (cherry picked from commit 5251dff) (cherry picked from commit f3beb95)
aainscow
added a commit
to aainscow/ceph
that referenced
this pull request
Oct 14, 2026
… activates In an optimized EC pool, a sub-stripe write gives the shards it does not touch a partial_writes_last_complete (pwlc) range ending at that write. If peering later rolls the write back, a pwlc range that still ends at it is stale, and applying it moves a nonprimary shard's last_update and log head to a version that no longer exists. ceph#71579 ("osd: pwlc was able to retain values larger than the last_update") trims the pwlc copies the primary holds for divergent peers in proc_replica_log, but the primary's own copy is not trimmed. The new primary merges each peer's pwlc in update_peer_info() during GetInfo, before GetLog has decided the authoritative log, so it keeps a range ending at a write that peering then rolls back. proc_master_log() would trim it, but does not run when the primary is its own log source. activate() then stamps the stale range with a new epoch, making it the definitive copy, and sends it to the peers. The nonprimary shards apply it and move their last_update and log head to the rolled-back version, so the next write to them, which reuses that version number, asserts in IndexedLog::add; a shard left with such a last_update can also be picked later as the log source and then never be recovered. The primary's log is authoritative once it activates, so no pwlc range may end past its head. activate() now trims pwlc to the head before stamping the epoch, which also covers ranges merged after GetLog in WaitUpThru and from peers whose log head already matched. A nonprimary shard keeps its own pwlc too, and update_peer_info() applies its own range after merging only the ranges the primary sends. When no primary-capable shard of the new interval saw a partial write that skipped it, the primary sends no range for it, so the shard applies its stale range again right after the primary's MInfoRec has rewound its log. update_peer_info() now trims a nonprimary shard's pwlc to the primary's last_update before applying it. The range for its own shard that a replica applies from an MLogRec before merging the log is capped at the sender's last_update the same way. With the activate() change a primary no longer sends such a range; the cap is defensive, for mixed-version clusters during an upgrade where the primary still runs older code. Tested by TestECFailoverWithPeering.RolledBackPeeredWriteLeavesNoStalePwlc and RolledBackPeeredWriteLeavesNoStaleReplicaPwlc in the following commit. Fixes: https://tracker.ceph.com/issues/81283 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]> (cherry picked from commit 5251dff) (cherry picked from commit f3beb95)
aainscow
added a commit
to aainscow/ceph
that referenced
this pull request
Oct 14, 2026
… activates In an optimized EC pool, a sub-stripe write gives the shards it does not touch a partial_writes_last_complete (pwlc) range ending at that write. If peering later rolls the write back, a pwlc range that still ends at it is stale, and applying it moves a nonprimary shard's last_update and log head to a version that no longer exists. ceph#71579 ("osd: pwlc was able to retain values larger than the last_update") trims the pwlc copies the primary holds for divergent peers in proc_replica_log, but the primary's own copy is not trimmed. The new primary merges each peer's pwlc in update_peer_info() during GetInfo, before GetLog has decided the authoritative log, so it keeps a range ending at a write that peering then rolls back. proc_master_log() would trim it, but does not run when the primary is its own log source. activate() then stamps the stale range with a new epoch, making it the definitive copy, and sends it to the peers. The nonprimary shards apply it and move their last_update and log head to the rolled-back version, so the next write to them, which reuses that version number, asserts in IndexedLog::add; a shard left with such a last_update can also be picked later as the log source and then never be recovered. The primary's log is authoritative once it activates, so no pwlc range may end past its head. activate() now trims pwlc to the head before stamping the epoch, which also covers ranges merged after GetLog in WaitUpThru and from peers whose log head already matched. A nonprimary shard keeps its own pwlc too, and update_peer_info() applies its own range after merging only the ranges the primary sends. When no primary-capable shard of the new interval saw a partial write that skipped it, the primary sends no range for it, so the shard applies its stale range again right after the primary's MInfoRec has rewound its log. update_peer_info() now trims a nonprimary shard's pwlc to the primary's last_update before applying it. The range for its own shard that a replica applies from an MLogRec before merging the log is capped at the sender's last_update the same way. With the activate() change a primary no longer sends such a range; the cap is defensive, for mixed-version clusters during an upgrade where the primary still runs older code. Tested by TestECFailoverWithPeering.RolledBackPeeredWriteLeavesNoStalePwlc and RolledBackPeeredWriteLeavesNoStaleReplicaPwlc in the following commit. Fixes: https://tracker.ceph.com/issues/81283 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]> (cherry picked from commit 5251dff) (cherry picked from commit f3beb95)
aainscow
added a commit
to aainscow/ceph
that referenced
this pull request
Oct 14, 2026
… activates In an optimized EC pool, a sub-stripe write gives the shards it does not touch a partial_writes_last_complete (pwlc) range ending at that write. If peering later rolls the write back, a pwlc range that still ends at it is stale, and applying it moves a nonprimary shard's last_update and log head to a version that no longer exists. ceph#71579 ("osd: pwlc was able to retain values larger than the last_update") trims the pwlc copies the primary holds for divergent peers in proc_replica_log, but the primary's own copy is not trimmed. The new primary merges each peer's pwlc in update_peer_info() during GetInfo, before GetLog has decided the authoritative log, so it keeps a range ending at a write that peering then rolls back. proc_master_log() would trim it, but does not run when the primary is its own log source. activate() then stamps the stale range with a new epoch, making it the definitive copy, and sends it to the peers. The nonprimary shards apply it and move their last_update and log head to the rolled-back version, so the next write to them, which reuses that version number, asserts in IndexedLog::add; a shard left with such a last_update can also be picked later as the log source and then never be recovered. The primary's log is authoritative once it activates, so no pwlc range may end past its head. activate() now trims pwlc to the head before stamping the epoch, which also covers ranges merged after GetLog in WaitUpThru and from peers whose log head already matched. A nonprimary shard keeps its own pwlc too, and update_peer_info() applies its own range after merging only the ranges the primary sends. When no primary-capable shard of the new interval saw a partial write that skipped it, the primary sends no range for it, so the shard applies its stale range again right after the primary's MInfoRec has rewound its log. update_peer_info() now trims a nonprimary shard's pwlc to the primary's last_update before applying it. The range for its own shard that a replica applies from an MLogRec before merging the log is capped at the sender's last_update the same way. With the activate() change a primary no longer sends such a range; the cap is defensive, for mixed-version clusters during an upgrade where the primary still runs older code. Tested by TestECFailoverWithPeering.RolledBackPeeredWriteLeavesNoStalePwlc and RolledBackPeeredWriteLeavesNoStaleReplicaPwlc in the following commit. Fixes: https://tracker.ceph.com/issues/81283 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]> (cherry picked from commit 5251dff) (cherry picked from commit f3beb95)
aainscow
added a commit
to aainscow/ceph
that referenced
this pull request
Oct 15, 2026
… activates In an optimized EC pool, a sub-stripe write gives the shards it does not touch a partial_writes_last_complete (pwlc) range ending at that write. If peering later rolls the write back, a pwlc range that still ends at it is stale, and applying it moves a nonprimary shard's last_update and log head to a version that no longer exists. ceph#71579 ("osd: pwlc was able to retain values larger than the last_update") trims the pwlc copies the primary holds for divergent peers in proc_replica_log, but the primary's own copy is not trimmed. The new primary merges each peer's pwlc in update_peer_info() during GetInfo, before GetLog has decided the authoritative log, so it keeps a range ending at a write that peering then rolls back. proc_master_log() would trim it, but does not run when the primary is its own log source. activate() then stamps the stale range with a new epoch, making it the definitive copy, and sends it to the peers. The nonprimary shards apply it and move their last_update and log head to the rolled-back version, so the next write to them, which reuses that version number, asserts in IndexedLog::add; a shard left with such a last_update can also be picked later as the log source and then never be recovered. The primary's log is authoritative once it activates, so no pwlc range may end past its head. activate() now trims pwlc to the head before stamping the epoch, which also covers ranges merged after GetLog in WaitUpThru and from peers whose log head already matched. A nonprimary shard keeps its own pwlc too, and update_peer_info() applies its own range after merging only the ranges the primary sends. When no primary-capable shard of the new interval saw a partial write that skipped it, the primary sends no range for it, so the shard applies its stale range again right after the primary's MInfoRec has rewound its log. update_peer_info() now trims a nonprimary shard's pwlc to the primary's last_update before applying it. The range for its own shard that a replica applies from an MLogRec before merging the log is capped at the sender's last_update the same way. With the activate() change a primary no longer sends such a range; the cap is defensive, for mixed-version clusters during an upgrade where the primary still runs older code. Tested by TestECFailoverWithPeering.RolledBackPeeredWriteLeavesNoStalePwlc and RolledBackPeeredWriteLeavesNoStaleReplicaPwlc in the following commit. Fixes: https://tracker.ceph.com/issues/81283 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]>
aainscow
added a commit
to aainscow/ceph
that referenced
this pull request
Oct 16, 2026
… activates In an optimized EC pool, a sub-stripe write gives the shards it does not touch a partial_writes_last_complete (pwlc) range ending at that write. If peering later rolls the write back, a pwlc range that still ends at it is stale, and applying it moves a nonprimary shard's last_update and log head to a version that no longer exists. ceph#71579 ("osd: pwlc was able to retain values larger than the last_update") trims the pwlc copies the primary holds for divergent peers in proc_replica_log, but the primary's own copy is not trimmed. The new primary merges each peer's pwlc in update_peer_info() during GetInfo, before GetLog has decided the authoritative log, so it keeps a range ending at a write that peering then rolls back. proc_master_log() would trim it, but does not run when the primary is its own log source. activate() then stamps the stale range with a new epoch, making it the definitive copy, and sends it to the peers. The nonprimary shards apply it and move their last_update and log head to the rolled-back version, so the next write to them, which reuses that version number, asserts in IndexedLog::add; a shard left with such a last_update can also be picked later as the log source and then never be recovered. The primary's log is authoritative once it activates, so no pwlc range may end past its head. activate() now trims pwlc to the head before stamping the epoch, which also covers ranges merged after GetLog in WaitUpThru and from peers whose log head already matched. A nonprimary shard keeps its own pwlc too, and update_peer_info() applies its own range after merging only the ranges the primary sends. When no primary-capable shard of the new interval saw a partial write that skipped it, the primary sends no range for it, so the shard applies its stale range again right after the primary's MInfoRec has rewound its log. update_peer_info() now trims a nonprimary shard's pwlc to the primary's last_update before applying it. The range for its own shard that a replica applies from an MLogRec before merging the log is capped at the sender's last_update the same way. With the activate() change a primary no longer sends such a range; the cap is defensive, for mixed-version clusters during an upgrade where the primary still runs older code. Tested by TestECFailoverWithPeering.RolledBackPeeredWriteLeavesNoStalePwlc and RolledBackPeeredWriteLeavesNoStaleReplicaPwlc in the following commit. Fixes: https://tracker.ceph.com/issues/81283 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]>
aainscow
added a commit
to aainscow/ceph
that referenced
this pull request
Oct 19, 2026
In an optimized EC pool, a sub-stripe write gives the shards it does not touch a partial_writes_last_complete (pwlc) range ending at that write. If peering later rolls the write back, a pwlc range that still ends at it is stale, and applying it moves a nonprimary shard's last_update and log head to a version that no longer exists. ceph#71579 ("osd: pwlc was able to retain values larger than the last_update") trims the pwlc copies the primary holds for divergent peers in proc_replica_log, but the primary's own copy is not trimmed. The new primary merges each peer's pwlc in update_peer_info() during GetInfo, before GetLog has decided the authoritative log, so it keeps a range ending at a write that peering then rolls back. proc_master_log() would trim it, but does not run when the primary is its own log source. activate() then stamps the stale range with a new epoch, making it the definitive copy, and sends it to the peers. The nonprimary shards apply it and move their last_update and log head to the rolled-back version, so the next write to them, which reuses that version number, asserts in IndexedLog::add; a shard left with such a last_update can also be picked later as the log source and then never be recovered. The primary's log is authoritative once it activates, so no pwlc range may end past its head. activate() now trims pwlc to the head before stamping the epoch, which also covers ranges merged after GetLog in WaitUpThru and from peers whose log head already matched. A nonprimary shard keeps its own pwlc too, and update_peer_info() applies its own range after merging only the ranges the primary sends. When no primary-capable shard of the new interval saw a partial write that skipped it, the primary sends no range for it, so the shard applies its stale range again right after the primary's MInfoRec has rewound its log. update_peer_info() now trims a nonprimary shard's pwlc to the primary's last_update before applying it. The range for its own shard that a replica applies from an MLogRec before merging the log is capped at the sender's last_update the same way. With the activate() change a primary no longer sends such a range; the cap is defensive, for mixed-version clusters during an upgrade where the primary still runs older code. Tested by TestECFailoverWithPeering.RolledBackPeeredWriteLeavesNoStalePwlc and RolledBackPeeredWriteLeavesNoStaleReplicaPwlc in the following commit. Fixes: https://tracker.ceph.com/issues/81283 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]>
5 of 14 tasks
aainscow
added a commit
to aainscow/ceph
that referenced
this pull request
Nov 16, 2026
In an optimized EC pool, a sub-stripe write gives the shards it does not touch a partial_writes_last_complete (pwlc) range ending at that write. If peering later rolls the write back, a pwlc range that still ends at it is stale, and applying it moves a nonprimary shard's last_update and log head to a version that no longer exists. ceph#71579 ("osd: pwlc was able to retain values larger than the last_update") trims the pwlc copies the primary holds for divergent peers in proc_replica_log, but the primary's own copy is not trimmed. The new primary merges each peer's pwlc in update_peer_info() during GetInfo, before GetLog has decided the authoritative log, so it keeps a range ending at a write that peering then rolls back. proc_master_log() would trim it, but does not run when the primary is its own log source. activate() then stamps the stale range with a new epoch, making it the definitive copy, and sends it to the peers. The nonprimary shards apply it and move their last_update and log head to the rolled-back version, so the next write to them, which reuses that version number, asserts in IndexedLog::add; a shard left with such a last_update can also be picked later as the log source and then never be recovered. The primary's log is authoritative once it activates, so no pwlc range may end past its head. activate() now trims pwlc to the head before stamping the epoch, which also covers ranges merged after GetLog in WaitUpThru and from peers whose log head already matched. A nonprimary shard keeps its own pwlc too, and update_peer_info() applies its own range after merging only the ranges the primary sends. When no primary-capable shard of the new interval saw a partial write that skipped it, the primary sends no range for it, so the shard applies its stale range again right after the primary's MInfoRec has rewound its log. update_peer_info() now trims a nonprimary shard's pwlc to the primary's last_update before applying it. The range for its own shard that a replica applies from an MLogRec before merging the log is capped at the sender's last_update the same way. With the activate() change a primary no longer sends such a range; the cap is defensive, for mixed-version clusters during an upgrade where the primary still runs older code. Tested by TestECFailoverWithPeering.RolledBackPeeredWriteLeavesNoStalePwlc and RolledBackPeeredWriteLeavesNoStaleReplicaPwlc in the following commit. Fixes: https://tracker.ceph.com/issues/81283 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]>
aainscow
added a commit
to aainscow/ceph
that referenced
this pull request
Nov 23, 2026
In an optimized EC pool, a sub-stripe write gives the shards it does not touch a partial_writes_last_complete (pwlc) range ending at that write. If peering later rolls the write back, a pwlc range that still ends at it is stale, and applying it moves a nonprimary shard's last_update and log head to a version that no longer exists. ceph#71579 ("osd: pwlc was able to retain values larger than the last_update") trims the pwlc copies the primary holds for divergent peers in proc_replica_log, but the primary's own copy is not trimmed. The new primary merges each peer's pwlc in update_peer_info() during GetInfo, before GetLog has decided the authoritative log, so it keeps a range ending at a write that peering then rolls back. proc_master_log() would trim it, but does not run when the primary is its own log source. activate() then stamps the stale range with a new epoch, making it the definitive copy, and sends it to the peers. The nonprimary shards apply it and move their last_update and log head to the rolled-back version, so the next write to them, which reuses that version number, asserts in IndexedLog::add; a shard left with such a last_update can also be picked later as the log source and then never be recovered. The primary's log is authoritative once it activates, so no pwlc range may end past its head. activate() now trims pwlc to the head before stamping the epoch, which also covers ranges merged after GetLog in WaitUpThru and from peers whose log head already matched. A nonprimary shard keeps its own pwlc too, and update_peer_info() applies its own range after merging only the ranges the primary sends. When no primary-capable shard of the new interval saw a partial write that skipped it, the primary sends no range for it, so the shard applies its stale range again right after the primary's MInfoRec has rewound its log. update_peer_info() now trims a nonprimary shard's pwlc to the primary's last_update before applying it. The range for its own shard that a replica applies from an MLogRec before merging the log is capped at the sender's last_update the same way. With the activate() change a primary no longer sends such a range; the cap is defensive, for mixed-version clusters during an upgrade where the primary still runs older code. Tested by TestECFailoverWithPeering.RolledBackPeeredWriteLeavesNoStalePwlc and RolledBackPeeredWriteLeavesNoStaleReplicaPwlc in the following commit. Fixes: https://tracker.ceph.com/issues/81283 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]> (cherry picked from commit 087606b) Conflicts: src/test/osd/TestECFailoverWithPeering.cc The test commit of the original PR (f45dea8) is not backported: this file does not exist on tentacle (the EC peering test harness was not backported there).
aainscow
added a commit
to aainscow/ceph
that referenced
this pull request
Nov 23, 2026
In an optimized EC pool, a sub-stripe write gives the shards it does not touch a partial_writes_last_complete (pwlc) range ending at that write. If peering later rolls the write back, a pwlc range that still ends at it is stale, and applying it moves a nonprimary shard's last_update and log head to a version that no longer exists. ceph#71579 ("osd: pwlc was able to retain values larger than the last_update") trims the pwlc copies the primary holds for divergent peers in proc_replica_log, but the primary's own copy is not trimmed. The new primary merges each peer's pwlc in update_peer_info() during GetInfo, before GetLog has decided the authoritative log, so it keeps a range ending at a write that peering then rolls back. proc_master_log() would trim it, but does not run when the primary is its own log source. activate() then stamps the stale range with a new epoch, making it the definitive copy, and sends it to the peers. The nonprimary shards apply it and move their last_update and log head to the rolled-back version, so the next write to them, which reuses that version number, asserts in IndexedLog::add; a shard left with such a last_update can also be picked later as the log source and then never be recovered. The primary's log is authoritative once it activates, so no pwlc range may end past its head. activate() now trims pwlc to the head before stamping the epoch, which also covers ranges merged after GetLog in WaitUpThru and from peers whose log head already matched. A nonprimary shard keeps its own pwlc too, and update_peer_info() applies its own range after merging only the ranges the primary sends. When no primary-capable shard of the new interval saw a partial write that skipped it, the primary sends no range for it, so the shard applies its stale range again right after the primary's MInfoRec has rewound its log. update_peer_info() now trims a nonprimary shard's pwlc to the primary's last_update before applying it. The range for its own shard that a replica applies from an MLogRec before merging the log is capped at the sender's last_update the same way. With the activate() change a primary no longer sends such a range; the cap is defensive, for mixed-version clusters during an upgrade where the primary still runs older code. Tested by TestECFailoverWithPeering.RolledBackPeeredWriteLeavesNoStalePwlc and RolledBackPeeredWriteLeavesNoStaleReplicaPwlc in the following commit. Fixes: https://tracker.ceph.com/issues/81283 Assisted-by: Claude Code Signed-off-by: Alex Ainscow <[email protected]> (cherry picked from commit 087606b) Conflicts: src/test/osd/TestECFailoverWithPeering.cc The test commit of the original PR (f45dea8) is not backported: the test uses set_pool_min_size() from the main test fixture, which umbrella lacks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In certain scenarios during peering, it was possible for us to tell other nodes they needed to roll back their last update when we have divergent entries. PGLog::proc_replica_log is one of these places where we merge divergent entries and potentially roll back the last update, however what we do not do when we do this is modify the pwlc in like we do in proc_master_log when this happens. Because of this, this means we have the potential to have a pwlc with a newer version in it than the agreed upon latest update, which it is then possible to be propogated out to non-primary shards causing each of those shards to assert as I saw in my local test. I've put together this fix which limits the the value of proc_master_log after deciding on a new value for last_update.
Below is the summary of the timeline where I observed this:
Tracker ticket: https://tracker.ceph.com/issues/80360
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.