Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: implement mini-batch & continue-as-new for replicator workflow #94

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion config/chainstorage/aptos/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/arbitrum/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/avacchain/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/base/goerli/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/base/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/bitcoin/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/bsc/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/dogecoin/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/ethereum/goerli/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/ethereum/holesky/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/ethereum/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/fantom/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/optimism/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/polygon/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/polygon/testnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config/chainstorage/solana/mainnet/base.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion config_templates/config/base.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,12 @@ workflows:
workflow_execution_timeout: 24h
workflow_identity: workflow.event_backfiller
replicator:
activity_retry_maximum_attempts: 3
activity_retry_maximum_attempts: 5
activity_schedule_to_start_timeout: 5m
activity_start_to_close_timeout: 10m
batch_size: 1000
mini_batch_size: 100
checkpoint_size: 10000
parallelism: 10
task_list: default
workflow_decision_timeout: 2m
Expand Down
2 changes: 2 additions & 0 deletions internal/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ type (
ReplicatorWorkflowConfig struct {
WorkflowConfig `mapstructure:",squash"`
BatchSize uint64 `mapstructure:"batch_size" validate:"required"`
MiniBatchSize uint64 `mapstructure:"mini_batch_size" validate:"required"`
CheckpointSize uint64 `mapstructure:"checkpoint_size" validate:"required,gtfield=BatchSize"`
Parallelism int `mapstructure:"parallelism" validate:"required"`
}

Expand Down
1 change: 1 addition & 0 deletions internal/workflow/activity/activity.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const (
ActivityEventReconciler = "activity.event_reconciler"
ActivityEventLoader = "activity.event_loader"
ActivityReplicator = "activity.replicator"
ActivityUpdateWatermark = "activity.update_watermark"

loggerMsg = "activity.request"

Expand Down
1 change: 1 addition & 0 deletions internal/workflow/activity/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,5 @@ var Module = fx.Options(
fx.Provide(NewEventReconciler),
fx.Provide(NewEventLoader),
fx.Provide(NewReplicator),
fx.Provide(NewUpdateWatermark),
)
Loading
Loading