Skip to content

DAOS-19636 object: read layout under lock in obj_ptr2shards - #19199

Merged
mchaarawi merged 1 commit into
liang/b2_8_layout_racefrom
mschaara/DAOS-19636-obj-need-coll-race
Oct 4, 2026
Merged

mchaarawi merged 1 commit into
liang/b2_8_layout_racefrom
mschaara/DAOS-19636-obj-need-coll-race

Conversation

@mchaarawi

Copy link
Copy Markdown
Contributor

obj_ptr2shards() read cob_shards_nr, cob_grp_size and cob_grp_nr without cob_lock. A concurrent obj_layout_refresh() (e.g. right after reintegration) frees and rebuilds the layout under the write lock, so a stat/punch/sync could see cob_shards_nr == 0 and trip:

Assertion '*grp_nr == obj->cob_grp_nr' failed: Unmatched grp nr: 0/16

Read the layout under cob_lock, check it matches the request map version, and return -DER_STALE instead of asserting, as obj_dkey2grpidx() does.

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).

obj_ptr2shards() read cob_shards_nr, cob_grp_size and cob_grp_nr without
cob_lock. A concurrent obj_layout_refresh() (e.g. right after
reintegration) frees and rebuilds the layout under the write lock, so a
stat/punch/sync could see cob_shards_nr == 0 and trip:

  Assertion '*grp_nr == obj->cob_grp_nr' failed: Unmatched grp nr: 0/16

Read the layout under cob_lock, check it matches the request map version,
and return -DER_STALE instead of asserting, as obj_dkey2grpidx() does.

Signed-off-by: Mohamad Chaarawi <mohamad.chaarawi@hpe.com>
@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

Ticket title is 'Object client may use inconsistent layout data during replica retry'
Status is 'Reopened'
Job should run at elevated priority (1)
https://daosio.atlassian.net/browse/DAOS-19636

@github-actions github-actions Bot added the priority Ticket has high priority (automatically managed) label Oct 3, 2026
@mchaarawi
mchaarawi marked this pull request as ready for review October 3, 2026 20:05
@mchaarawi
mchaarawi merged commit 667aa47 into liang/b2_8_layout_race Oct 4, 2026
35 of 36 checks passed
@mchaarawi
mchaarawi deleted the mschaara/DAOS-19636-obj-need-coll-race branch October 4, 2026 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority Ticket has high priority (automatically managed)

Development

Successfully merging this pull request may close these issues.

1 participant