Repository navigation
Conversation
This was referenced Oct 15, 2026
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
…ry (#918) The hybrid registry is written by local nodes and burst members alike, but only LocalProvider read it. EC2Provider.DiscoverPeers looked at tags only, so a burst instance saw its EC2 siblings and never the local nodes of its job array: discovery worked one way. A burst member (spawn:burst=true, parsed into Config.Burst exactly as #920 does) now also queries the registry and merges its entries with the tag peers, one entry per instance, the tag entry winning a collision since it carries the spore.host DNS name. A registry read failure keeps the tag peers and logs a warning. Ordinary members stay tag-only and never query the table. The registry query and its parsing move into pkg/provider/hybrid_registry.go, shared with the local provider (which also gains pagination). The table name is pinned to registry.TableName by a test, and the spored IAM grant gate now discovers the DynamoDB calls this reader makes as well as PeerRegistry's. Fixes #918.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #926 (base
fix/905). Review that first; this PR's diff is only the #918 change.Problem
The hybrid registry (
spawn-hybrid-registry) is written by local nodes and by burst members, but onlyLocalProvider.DiscoverPeersread it.EC2Provider.DiscoverPeersranDescribeInstancesonspawn:job-array-idand nothing else. A burst instance found its EC2 siblings but never the local nodes it was launched to work alongside. Local nodes saw burst instances; burst instances did not see local nodes.Fix
Config.Burstis set (fromspawn:burst=true),EC2Provider.DiscoverPeersalso queries the registry and merges the entries with the tag peers throughmergePeers:readsHybridRegistry()is false withoutBurst, so aspawn launch --countmember never queries the table.Config.Burstand its tag parse match Register only hybrid job-array members with the hybrid registry (#904) #920's hunks exactly. This PR does not depend on Register only hybrid job-array members with the hybrid registry (#904) #920, and git sees the same lines on both sides when they merge. Register only hybrid job-array members with the hybrid registry (#904) #920'spkg/provider/burst_tag_test.gois not duplicated; the tests here use their own names.pkg/provider/hybrid_registry.goand is used by both providers. The local provider's read now also followsLastEvaluatedKeypages.provider.HybridRegistryTablereplaces the local provider's string literal. pkg/provider cannot import pkg/registry (a cycle), so a test in pkg/registry pins the two table names together.registryClientActionsdiscovered DynamoDB calls only frompkg/registry/dynamodb.go. Burst members now also issue registry calls frompkg/provider/hybrid_registry.gowith the spored role, so the gate scans both files. It fails if either file yields no calls. The action set is unchanged (Querywas already granted).Tests
pkg/provider/burst_discovery_test.go, run against Substrate. Members are built the way spored builds them: config read back from the instance's own tags withloadConfigFromEC2Tags.TestEC2Provider_BurstMemberDiscoversLocalNodesFromTheRegistryis Burst (EC2) members of a hybrid job array never read the hybrid registry, so they cannot discover local nodes #918's suggested test. A burst member's discovery includes the registry'sprovider=localentry once and itself once (deduplicated), with its DNS name kept.TestEC2Provider_OrdinaryMemberDiscoveryIsTagOnly: nospawn:burstmeans zero registry queries and no local peer.TestEC2Provider_BurstMemberKeepsTagPeersWhenTheRegistryFailsTestReadsHybridRegistryandTestMergePeerstest the gate and the merge directly (rule 2).pkg/registryTestTableNameAgreesWithProviderEach test was watched failing against a revert that compiles, with
go vetclean on each reverted tree:if true || !p.readsHybridRegistry()(never read the registry)…DiscoversLocalNodesFromTheRegistry,…KeepsTagPeersWhenTheRegistryFailsp.config.Burst…OrdinaryMemberDiscoveryIsTagOnly,TestReadsHybridRegistryif false && seen[…]…DiscoversLocalNodesFromTheRegistry,TestMergePeersfalse && ……DiscoversLocalNodesFromTheRegistry,…KeepsTagPeersWhenTheRegistryFailsreturn nil, err…KeepsTagPeersWhenTheRegistryFails…DiscoversLocalNodesFromTheRegistry,TestMergePeersHybridRegistryTablerenamedTestTableNameAgreesWithProviderclient.Scan(source text the gate reads)TestBothSporedPolicyPathsGrantTheHybridRegistry,TestHybridRegistryGrantIsNarrowmake checkpasses exceptTestGenerateWrapper_ChownFixesCrossUIDStickyUnlink_Docker, which needs a Docker daemon.make check-nestedreports all 9 nested modules clean. No public-package surface changed (pkg/providerandpkg/registryare internal), soapi/public-surface.txtis unchanged. No AWS resources were created and no instances were launched.Caveat, filed separately
Fixes #918