-
Notifications
You must be signed in to change notification settings - Fork 846
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
Refactor Redpanda Migrator components #3026
base: main
Are you sure you want to change the base?
Refactor Redpanda Migrator components #3026
Conversation
34421d0
to
081592f
Compare
a86bdbd
to
72237c4
Compare
d37239f
to
784ff42
Compare
log: res.Logger(), | ||
shutSig: shutdown.NewSignaller(), | ||
clientOpts: optsFn, | ||
topicLagGauge: res.Metrics().NewGauge("redpanda_lag", "topic", "partition"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When I added the redpanda_migrator
input, I had both this gauge and the kafka_lag
metadata field. I don't know if we want any of these available by default. Also, should this gauge name be somehow derived from the actual input type (redpanda
, redpanda_common
, redpanda_migrator
, redpanda_migrator_offsets
)? It does get the label of the input if set, so maybe that's sufficient.
784ff42
to
642fd09
Compare
Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: Mihai Todor <[email protected]>
- New `redpanda_migrator_offsets` input - Fields `offset_topic`, `offset_group`, `offset_partition`, `offset_commit_timestamp` and `offset_metadata` added to the `redpanda_migrator_offsets` output Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: Mihai Todor <[email protected]>
This is required in order to pull in twmb/franz-go#838 This is needed because the `redpanda_migrator` input needs to create all the matched topics during the first call to `ReadBatch()`. Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: Mihai Todor <[email protected]>
5de511f
to
a7b9103
Compare
Signed-off-by: Mihai Todor <[email protected]>
34c5d16
to
5749553
Compare
Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: Mihai Todor <[email protected]>
Signed-off-by: Mihai Todor <[email protected]>
5749553
to
bcfeae2
Compare
@@ -76,18 +105,25 @@ type FranzReaderOrdered struct { | |||
|
|||
// NewFranzReaderOrderedFromConfig attempts to instantiate a new | |||
// FranzReaderOrdered reader from a parsed config. | |||
func NewFranzReaderOrderedFromConfig(conf *service.ParsedConfig, res *service.Resources, optsFn func() ([]kgo.Opt, error)) (*FranzReaderOrdered, error) { | |||
func NewFranzReaderOrderedFromConfig(conf *service.ParsedConfig, res *service.Resources, clientOptsFn clientOptsFn, recordToMessageFn recordToMessageFn, preflightHookFn preflightHookFn, closeHookFn closeHookFn) (*FranzReaderOrdered, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This constructor got a bit messy to use... It can be hard to tell which of these funcs is set to nil at the call site and one can easily mix them up. I'm thinking to maybe introduce functional options for it or maybe a struct which contain all the parameters. WDYT?
I hijacked this PR to address several issues:
Added
redpanda_migrator_offsets
input.offset_topic
,offset_group
,offset_partition
,offset_commit_timestamp
andoffset_metadata
added to theredpanda_migrator_offsets
output.kafka_key
andmax_in_flight
for theredpanda_migrator_offsets
output are now deprecated.batching
for theredpanda_migrator
output is now deprecated.topic_lag_refresh_period
added to theredpanda
andredpanda_common
inputs.redpanda_lag
now emitted by theredpanda
andredpanda_common
inputs.kafka_lag
now emitted by theredpanda
andredpanda_common
inputs.Fixed
redpanda_migrator_bundle
output now skips schema ID translation whentranslate_schema_ids: false
andschema_registry
is configured.redpanda_migrator
output no longer rejects messages if it can't perform schema ID translation.redpanda_migrator
input no longer converts the kafka key to string.Changed
kafka_key
andmax_in_flight
fields of theredpanda_migrator_offsets
output are now deprecated.batch_size
andmulti_header
for theredpanda_migrator
input are now deprecated.redpanda_migrator_bundle
input and output now set labels for their subcomponents.redpanda_migrator
input no longer emits tombstone messages.Redpanda Migrator offset metadata
One quick way to test this is via the following config. Note how I overwrite
kafka_offset_metadata
tofoobar
in amapping
processor.