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

Block-builder-scheduler initial structure #9650

Open
wants to merge 27 commits into
base: main
Choose a base branch
from

Conversation

seizethedave
Copy link
Contributor

@seizethedave seizethedave commented Oct 16, 2024

What this PR does

Adds initial structure for block-builder-scheduler living at pkg/blockbuilder/scheduler. Adds a new block-builder-scheduler target to the binary. This target currently just connects to Kafka and records per-partition start and end offset gauge metrics. In the future it will compute jobs and assign them to block-builder workers.

Checklist

  • Tests updated.
  • Documentation added.
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX].
  • about-versioning.md updated with experimental features.

@seizethedave seizethedave marked this pull request as ready for review October 18, 2024 16:49
@seizethedave seizethedave requested a review from a team as a code owner October 18, 2024 16:49
Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

The skeleton LGTM! I left few minor comments. No need for me to re-review it.

}

func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
f.StringVar(&cfg.BuilderConsumerGroup, "block-builder-scheduler.builder-consumer-group", "block-builder", "The Kafka consumer group used by block-builders.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Not sure what this will be used for. I didn't expect block builders to have a consumer group at all, given all offsets should be tracked by the scheduler. I suggest to remove this for now, and re-introduce it in a later PR if it will be effectively used (if so, why?).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah yes. This is something @codesome and I discussed: in the v1 of the scheduler, we'll just have the block-builder workers continue to checkpoint offsets to Kafka. For 2 reasons:

  1. get v1 out quicker
  2. less risky for backlogs: if there is a large backlog that takes 6 hours to consume, we'll get smaller section-granularity checkpoints rather than everything riding on that 6 hour job to complete.

(But it's mostly about reason number 1.) Let me know your thoughts.

pkg/blockbuilder/scheduler/config.go Outdated Show resolved Hide resolved

func (cfg *Config) RegisterFlags(f *flag.FlagSet) {
f.StringVar(&cfg.BuilderConsumerGroup, "block-builder-scheduler.builder-consumer-group", "block-builder", "The Kafka consumer group used by block-builders.")
f.StringVar(&cfg.SchedulerConsumerGroup, "block-builder-scheduler.scheduler-consumer-group", "block-builder-scheduler", "The Kafka consumer group used by block-builder-scheduler.")
Copy link
Collaborator

Choose a reason for hiding this comment

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

Consider removing scheduler- prefix if ends up we'll not need the builder consumer groups too.

Suggested change
f.StringVar(&cfg.SchedulerConsumerGroup, "block-builder-scheduler.scheduler-consumer-group", "block-builder-scheduler", "The Kafka consumer group used by block-builder-scheduler.")
f.StringVar(&cfg.SchedulerConsumerGroup, "block-builder-scheduler.consumer-group", "block-builder-scheduler", "The Kafka consumer group used by block-builder-scheduler.")

pkg/blockbuilder/scheduler/config.go Outdated Show resolved Hide resolved
pkg/blockbuilder/scheduler/metrics.go Outdated Show resolved Hide resolved
pkg/blockbuilder/scheduler/metrics.go Outdated Show resolved Hide resolved
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.

2 participants