Skip to content

core: include shard_id.hh instead of redeclaring shard_id - #324

Merged
travisdowns merged 1 commit into
redpanda-data:v26.3.xfrom
travisdowns:td-shard-id-alias-v26.3.x
Oct 29, 2026
Merged

travisdowns merged 1 commit into
redpanda-data:v26.3.xfrom
travisdowns:td-shard-id-alias-v26.3.x

Conversation

@travisdowns

Copy link
Copy Markdown
Member

reactor.hh and io_queue.hh each redeclared using shard_id = unsigned
rather than including shard_id.hh, which already declares it. The
redeclarations are legal, but they confuse include-what-you-use: it
attributes a use of shard_id to whichever declaration it resolves, so
code that includes reactor.hh or io_queue.hh for something else gets
told that shard_id comes from there. IWYU then suggests dropping
<seastar/core/shard_id.hh> in favor of the much heavier reactor.hh or
io_queue.hh.

Remove the redeclarations and include shard_id.hh in both headers, so
shard_id.hh is the single place the alias is declared.

(cherry picked from commit 187dbc2)

Downstream of upstream scylladb/seastar#3778. Clean cherry-pick.

reactor.hh and io_queue.hh each redeclared `using shard_id = unsigned`
rather than including shard_id.hh, which already declares it. The
redeclarations are legal, but they confuse include-what-you-use: it
attributes a use of shard_id to whichever declaration it resolves, so
code that includes reactor.hh or io_queue.hh for something else gets
told that shard_id comes from there. IWYU then suggests dropping
<seastar/core/shard_id.hh> in favor of the much heavier reactor.hh or
io_queue.hh.

Remove the redeclarations and include shard_id.hh in both headers, so
shard_id.hh is the single place the alias is declared.

(cherry picked from commit 187dbc2)
@travisdowns
travisdowns requested review from StephanDollberg and ballard26 and a balanced review from Copilot October 29, 2026 05:21
@travisdowns
travisdowns enabled auto-merge (rebase) October 29, 2026 05:22
@travisdowns

Copy link
Copy Markdown
Member Author

auto merge enabled

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@travisdowns

Copy link
Copy Markdown
Member Author

(Needed for IWYU)

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@travisdowns
travisdowns merged commit efe4e25 into redpanda-data:v26.3.x Oct 29, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants