Conversation
|
✅ No conflicts with other open PRs targeting |
|
I see you updated files related to
|
| }); err != nil { | ||
| return nil, fmt.Errorf("failed to update settings: %w", err) | ||
| spec := j.CRESettingsSpec | ||
| configType := spec.ConfigType |
There was a problem hiding this comment.
cc @jmank88 are you OK with this extension? Soon we can also add the third type for offchain Capabilities Registry (FYI @vyzaldysanchez )
There was a problem hiding this comment.
I've refactored this a bit after @pavel-raykov 's suggestion. pls have a look
| type ShardAssignmentConfig struct { | ||
| StaticDefaultAssignment []uint32 | ||
| DisabledShards []uint32 | ||
| PerOwnerAssignment map[string][]uint32 |
There was a problem hiding this comment.
Let's add perOrg too. I'm about to send a caching extension to OrgResolver and we will soon stop failing open on missing orgs. Orgs are much easier to manage in the config compared to owners.
There was a problem hiding this comment.
how about we do this PR with owners initially and make a separate with an extension for orgs? that might be just easier to comprehend and review from the risks perspectives
| ) | ||
|
|
||
| type ShardResolver interface { | ||
| ResolveShard(ctx context.Context, workflowID string, ownerHex string) (shardID uint32, found bool, err error) |
|




Enables manual shard assignments
owner->shard.Scope:
ShardAssignmentModefield added to[Sharding]TOML config with 3 mode constants (ringocr-only,manual-only,ringocr-with-overrides). Validation updated to skipShardOrchestratorAddressrequirement formanual-only.CRESettingsjob spec —config_typekey inside the existing settings TOML column branches between regular settings and shard assignment. No DB migration needed.validate.goparses and validates accordingly.delegate.goroutes to a dedicatedAtomicSettingsinstance for shard assignment, reusing the existingStore()pattern.ShardResolver(shardownership/resolver.go) — New interface with 3 implementations:ringOCRShardResolver— wraps ShardOrchestrator client (existing behavior)manualShardResolver— loads shard assignment TOML from AtomicSettings, parses it, O(1) owner→shard map lookup, no external depsoverrideShardResolver— manual wins for static owners, delegates to RingOCR for hashed ownerscre.gocreates the resolver based on mode.workflow_registry.go'sfilterWorkflowsBySharduses the resolver with owner hex fromWorkflowMetadataView.Owner. Engine execution guard uses the resolver withEngineConfig.WorkflowOwner.application.goskipsShardOrchestratorinfrastructure inmanual-onlymode.ShardAssignmentJobtype prependsconfig_type = "shard_assignment"to the settings TOML, reuses the existingcre-settings.tmpltemplate.ProposeShardAssignmentJoboperation added.Tests:
cre-4958