Skip to content

Use TOML ShardIndex instead of DON ID for shard failover manager - #23802

Draft
bolekk wants to merge 2 commits into
developfrom
shard_id_not_don_id
Draft

bolekk wants to merge 2 commits into
developfrom
shard_id_not_don_id

Conversation

@bolekk

@bolekk bolekk commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Summary

  • ShardFailoverManagerConfig had a single MyShardID field that conflated two distinct identities: the node's DON ID and its shard index. It was originally being populated from myDonID even where shard-index semantics were needed (e.g. comparisons against ShardResolver/ShardOrchestratorClient results).
  • Split it into two fields:
    • MyDONID — this node's DON identity, used for the PrimaryDonId field sent to the secondary shard.
    • MyShardIndex — this node's shard index, sourced from the Sharding.ShardIndex TOML config (via a new WithShardIndex handler option), used for all shard-ownership comparisons and logging.

Test plan

  • go build/go vet pass for core/services/workflows/syncer/v2 and core/services/cre
  • TestShardFailoverManager_MultipleWorkflowsSharedDispatcher and TestShardFailoverManager_DispatcherRejectsDuplicateReceiver pass
  • Manually verify on a sharded cluster that shard-ownership logs/metrics report myShardIndex equal to each node's configured Sharding.ShardIndex, and that PrimaryDonId on the wire still reflects the primary's DON ID

Deployment Validation

Confirm shard failover logs report myShardIndex equal to each node's configured Sharding.ShardIndex, and PrimaryDonId on the wire still matches the primary's DON ID.

🤖 Generated with Claude Code

MyShardID in the v2 workflow syncer handler was populated from myDonID,
conflating the node's DON ID with its shard identity. Source it from the
Sharding.ShardIndex TOML config instead, which is what ShardResolver and
ShardDonLookup actually key on.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

✅ No conflicts with other open PRs targeting develop

@github-actions

Copy link
Copy Markdown
Contributor

I see you updated files related to core. Please run make gocs in the root directory to add a changeset as well as in the text include at least one of the following tags:

  • #added For any new functionality added.
  • #breaking_change For any functionality that requires manual action for the node to boot.
  • #bugfix For bug fixes.
  • #changed For any change to the existing functionality.
  • #db_update For any feature that introduces updates to database schema.
  • #deprecation_notice For any upcoming deprecation functionality.
  • #internal For changesets that need to be excluded from the final changelog.
  • #nops For any feature that is NOP facing and needs to be in the official Release Notes for the release.
  • #removed For any functionality/config that is removed.
  • #updated For any functionality that is updated.
  • #wip For any change that is not ready yet and external communication about it should be held off till it is feature complete.

@bolekk
bolekk force-pushed the shard_id_not_don_id branch 2 times, most recently from fb83062 to 758d3ba Compare September 22, 2026 19:42
@trunk-io

trunk-io Bot commented Sep 22, 2026

Copy link
Copy Markdown

Static BadgeStatic BadgeStatic Badge

Failed Test Failure Summary Logs
Test_CRE_V2_ShardedCapabilitiesManualEVMLogTrigger The test failed during the execution of a blockchain-related workflow, but the specific cause of failure is not provided in the log snippet. Logs ↗︎
Test_CRE_V2_FailoverManualSwap The test failed during the failover manual swap process, likely due to an issue with workflow artifact copying or container permissions. Logs ↗︎
Test_CRE_V2_ShardManualAssignment The test failed during the setup or execution phase, but the specific error message indicating the cause is not provided in the logs. Logs ↗︎

View Full Report ↗︎Docs

MyShardID conflated two distinct identities: the DON ID reported to the
secondary shard (PrimaryDonId on the wire) and the shard index used for
ownership comparisons against ShardResolver/ShardOrchestratorClient. Split
it into MyDONID (DON identity) and MyShardIndex (shard identity, sourced
from the TOML Sharding.ShardIndex config) and route each usage to the
correct one.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@bolekk
bolekk force-pushed the shard_id_not_don_id branch from 758d3ba to cb256be Compare September 22, 2026 20:12
@cl-sonarqube-production

Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant