Bug #76577
closedFeature #75023: Support for Erasure Coded Metadata Pools
Feature #74186: Support for OMAPs in EC Pools
Fix condition for rolling forward the pg log in PeeringState.cc
100%
Description
- if (transaction_applied &&
- p->soid > info.last_backfill) {
+ if (transaction_applied && !is_acting(pg_whoami)) {
MW Updated by Matty Williams 7 months ago
- Status changed from In Progress to Fix Under Review
- % Done changed from 90 to 100
BS Updated by Bill Scales 6 months ago
- Backport set to tentacle
This is a long standing bug in the code found during the development of omap support for EC pools.
When a shard is in backfill/recovery it still gets provided with the transactions + log entries for updates to objects that have already been recovered and gets empty transactions + log entries for updates to objects that have not yet been recovered.
The code wants to maintain a full log of updates to the PG, but has to be careful about rolling forward or backwards the log entries which include the rollback information that is used to undo incomplete writes during peering. When an empty transaction + log entry is received the rollback information in the log entry cannot be used because the empty transaction isn't saving the old state. The challenge is that
1. Log entries must be rolled forwards/backwards in order
2. Normally a shard does not roll forwards log entries until the write has been completed, and at this time the code has forgotten whether an empty transaction was provided
The existing code tried to deal with this by:
1. Rolling forward the log entry as soon as the transaction is applied rather than waiting for the write to be completed. Its only safe to do this because the shard is not in the acting set.
2. Skipping the roll forward if an empty transaction was provided as in this case there is no undo information. Again this is only safe to do because the shard is not in the acting set.
A bug meant that 1) never happened (the predicate on the if statement was always false), and this meant that these entries got rolled forward later when the write was completed. If however a second write with an empty transaction was received before this happened then the skip roll forward caused both these writes to be skipped. Here's the scenario:
- Write to good object A provides transaction + log entry. Update is made and log entry is added, but not rolled-forward due to bug
- Write to unrecovered object B provides empty transaction + log. Update and log entry is added, both log entries roll-forward are skipped. The undo information stored for object A is not deleted and leaks a small amount of storage.
- Write A get completed, log entry has already been skipped so isn't rolled forward
- Write B get completed, log entry has already been skipped so isn't rolled forward
With EC omap support the roll-forward operation is used to update the omap in the object store. This bug now means that not only is storage leaked, but updates to omap's don't happen causing a data integrity issue.
The fix is to the if statement so that when a transaction + log entry is provided for a shard doing backing/async recovery that it always rolls-forward the log entry immediately.
BS Updated by Bill Scales 6 months ago
During testing a further issue with this code was found with FastEC pools.
FastEC maintains pwlc state to track partial writes so that during peering it can reconcile logs from different shards which may have differences either because of incomplete writes (which must be rolled backwards) or because of partial writes which didn't need to update all the shards (which must be kept). The pwlc information is updated when log entries are rolled forwards.
Shards that are backfilling/performing async recovery are performing the roll forwards before the write has been committed and this results in them producing pwlc data that overly optimistic. These shards need to invalidate their pwlc data and instead rely on shards in the acting set to provide an accurate view of pwlc.
When the code was fixed to roll-forward the I/O, we found that this code path wasn't invalidating pwlc. This broke a later Peering cycle and ended up with shards having divergent logs and asserting when the next log entry was appended. The fix for this was to make sure the fixed code path invalidates pwlc in exactly the same way as skip roll-forward code path.
BS Updated by Bill Scales 6 months ago
- Pull request ID set to 68888
MW Updated by Matty Williams 6 months ago
- Parent task set to #74186
MW Updated by Matty Williams 6 months ago
- Status changed from Fix Under Review to Resolved
MW Updated by Matty Williams 6 months ago
- Status changed from Resolved to Pending Backport
UB Updated by Upkeep Bot 6 months ago
- Merge Commit set to 8b35fcb47f7f35995d8d43865463d32b547a9a95
- Fixed In set to v21.0.0-2218-g8b35fcb47f
- Upkeep Timestamp set to 2026-06-10T15:22:03+00:00
UB Updated by Upkeep Bot 6 months ago
- Copied to Backport #77300: tentacle: Fix condition for rolling forward the pg log in PeeringState.cc added
UB Updated by Upkeep Bot 6 months ago
- Tags (freeform) set to backport_processed
UB Updated by Upkeep Bot 5 months ago
- Status changed from Pending Backport to Resolved
- Upkeep Timestamp changed from 2026-06-10T15:22:03+00:00 to 2026-07-15T01:21:12+00:00
UB Updated by Upkeep Bot 3 months ago
- Tags (freeform) deleted (
backport_processed) - Upkeep Timestamp changed from 2026-07-15T01:21:12+00:00 to 2026-08-28T01:42:10+00:00
UB Updated by Upkeep Bot about 1 month ago
- Released In set to v21.2.0~229
- Upkeep Timestamp changed from 2026-08-28T01:42:10+00:00 to 2026-10-24T02:03:59+00:00