Skip to content

DAOS-20112 object: EC agg must not pass unaggregated data - #19702

Open
liuxuezhao wants to merge 3 commits into
release/2.8from
lxz/ec_agg_stamp_28_pr
Open

liuxuezhao wants to merge 3 commits into
release/2.8from
lxz/ec_agg_stamp_28_pr

Conversation

@liuxuezhao

Copy link
Copy Markdown
Contributor
After a restart EC aggregation loads the timestamp of the last write
which needs aggregation from VOS, and skips the scan if it is not
newer than the aggregation epoch. VOS does not record it since 2.6.0
(VOS_POOL_FEAT_2_2 is not set at pool open), so zero is loaded and
taken as "nothing to aggregate": the aggregation epoch, and the
boundary derived from it, pass replicas which are not aggregated.
A rebuild or degraded fetch then decodes a data cell from the old
parity and the newer replicas of other cells: silent corruption.

That timestamp is an approximation made for VOS aggregation, and
what is on disk can be missing or stale. EC aggregation does not
use it any more:
- Container: the timestamp is kept in memory only. After a restart
  it is the current HLC, so the scan is not skipped until the
  aggregation epoch passes whatever was written before.
- Object: left out only by its latest write epoch (vo_max_write),
  if known. The lower bound of a forced scan is inclusive.
- Keys of an object which passed are not left out: the write
  timestamp cache is not updated by a write without DTX.
- Migration updates the timestamp of the container, as its writes
  are not from a client.
- With snapshots a round has several epoch ranges. A range which
  does not continue the aggregation epoch is left to a later round,
  it must not move the epoch over what an earlier range left.

A pool map update resets the aggregation epoch to the boundary, as
what was scanned with the old layout does not count. The reset was
detected by comparing the epoch before and after the scan of a
range only, so it was missed when the epoch was at the boundary
already. Compare the pool map version as well; both are saved once
per range, before the first attempt of the scan. When the range is
void end the round with a positive value, which is not an error,
so that the scheduler does not go on with the next range, nor takes
a forced scan as done. The same for a forced scan while the
boundary is unknown: nothing was scanned.

Signed-off-by: Xuezhao Liu <xuezhao.liu@hpe.com>
Signed-off-by: Wang Shilong <shilong.wang@hpe.com>

Steps for the author:

  • Commit message follows the guidelines.
  • Appropriate Features or Test-tag pragmas were used.
  • Appropriate Functional Test Stages were run.
  • At least two positive code reviews including at least one code owner from each category referenced in the PR.
  • Testing is complete. If necessary, forced-landing label added and a reason added in a comment.

After all prior steps are complete:

  • Gatekeeper requested (daos-gatekeeper added as a reviewer).

@liuxuezhao
liuxuezhao requested review from a team as code owners December 4, 2026 09:16
@daosbuild3

Copy link
Copy Markdown
Collaborator

@daosbuild3

Copy link
Copy Markdown
Collaborator

@liuxuezhao
liuxuezhao requested review from a team as code owners December 4, 2026 13:46
@liuxuezhao
liuxuezhao force-pushed the lxz/ec_agg_stamp_28_pr branch from 6d73256 to 92ef64f Compare December 4, 2026 14:21
After a restart EC aggregation loaded the timestamp of the last
write which needs aggregation from VOS, and skipped the scan if it
was not newer than the aggregation epoch. VOS does not record that
timestamp since 2.6.0, so zero was loaded and taken as "nothing to
aggregate": the aggregation epoch and the EC boundary passed
replicas which were not aggregated, and a later rebuild or degraded
fetch decoded data from the old parity and newer replicas.

EC aggregation does not use that timestamp any more:
- container: a timestamp in memory, the current HLC after a
  restart, so the scan goes on until the epoch passes it;
- object: skipped only by vo_max_write, if known;
- the keys of an object which passed are not skipped;
- migration updates the timestamp of the container.

The aggregation epoch only moves over what was scanned:
- an epoch range which does not continue the epoch is left to a
  later round;
- a range is void if the pool map changed during the scan, also
  if the epoch has the same value after the reset;
- a scan which finds a replica to be visited again at or below the
  epoch reports the epoch right below the replica;
- a range of a forced scan does not report over its upper bound,
  as a later range can still find such a replica.
In the second and third case the round ends without error and a
forced scan is not taken as done.

The epoch which a target reports can go back that way. The
reporter ignores the lower value as before, but does not log it as
an error any more, only a stable epoch going back.

Add srv_ec_agg_tests, the unit test of the next commit, to the
binaries which are stashed for the unit test stages of CI.

Signed-off-by: Xuezhao Liu <xuezhao.liu@hpe.com>
Signed-off-by: Wang Shilong <shilong.wang@hpe.com>
srv_ec_agg_tests drives the epoch ranges of a round as
cont_ec_aggregate_cb() does:
- after a restart the scan is not skipped until the aggregation
  epoch passes what was written before;
- a range which does not continue the epoch is left to a later
  round, an idle one is done;
- a pool map update during the scan voids the range, also with the
  same epoch value and after a retry of the scan;
- a forced scan is not done while the boundary is unknown;
- a replica found below the epoch ends the round and is reported;
- a forced scan which is retried does not report over it either;
- which objects are skipped by the epoch of their latest write.

VOS250.1 checks what the iterator gives to the filter callback
with VOS_IT_AGG_LAST_WRITE.

Signed-off-by: Xuezhao Liu <xuezhao.liu@hpe.com>
Without skipping the keys of an object which passed the object
filter, every round walks all the keys of an object which is
written all the time.

Skip a key by the write timestamp cache, which is in memory, not by
the timestamp stored in VOS. The cache does not see a write without
DTX, i.e. migration, so the container child keeps the time of the
last such write, starting with its own creation, and the cache is
only used once the aggregation epoch reached that time. A miss of
the cache does not skip the key.

Signed-off-by: Xuezhao Liu <xuezhao.liu@hpe.com>
@liuxuezhao
liuxuezhao force-pushed the lxz/ec_agg_stamp_28_pr branch from 92ef64f to ca80630 Compare December 4, 2026 14:57

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants