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

Use bounded list for offset manager #1567

Closed
wants to merge 3 commits into from

Conversation

vprithvi
Copy link
Collaborator

Which problem is this PR solving?

Resolves #1109

Short description of the changes

  • Bound the concurrent_list used by offset manager
  • Add a ParallelSpanProcessor that can signal when there are errors when processing spans via a channel
  • Update Consumer to handle errors from ParallelSpanProcessor by closing the partition. This should trigger a rebalance causing reprocessing from the last committed offset.

Signed-off-by: Prithvi Raj p.r@uber.com

@codecov
Copy link

codecov bot commented May 24, 2019

Codecov Report

Merging #1567 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1567      +/-   ##
==========================================
+ Coverage   98.21%   98.22%   +<.01%     
==========================================
  Files         195      195              
  Lines        9602     9632      +30     
==========================================
+ Hits         9431     9461      +30     
  Misses        134      134              
  Partials       37       37
Impacted Files Coverage Δ
cmd/ingester/app/processor/span_processor.go 100% <ø> (ø) ⬆️
cmd/ingester/app/consumer/offset/manager.go 100% <100%> (ø) ⬆️
...md/ingester/app/consumer/offset/concurrent_list.go 100% <100%> (ø) ⬆️
cmd/ingester/app/consumer/processor_factory.go 100% <100%> (ø) ⬆️
cmd/ingester/app/consumer/consumer.go 100% <100%> (ø) ⬆️
cmd/ingester/app/flags.go 100% <100%> (ø) ⬆️
cmd/ingester/app/processor/parallel_processor.go 100% <100%> (ø) ⬆️
cmd/ingester/app/consumer/committing_processor.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6cb3570...38f1df5. Read the comment docs.

cmd/ingester/app/consumer/consumer_metrics_test.go Outdated Show resolved Hide resolved
@@ -63,14 +65,17 @@ const (
DefaultEncoding = kafka.EncodingProto
// DefaultDeadlockInterval is the default deadlock interval
DefaultDeadlockInterval = 1 * time.Minute
// DefaultMaxOutOfOrderOffsets is the default max out of ourder offsets to maintain before restarting the processor
DefaultMaxOutOfOrderOffsets = 500000
Copy link
Contributor

Choose a reason for hiding this comment

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

How do we determine this default value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I used an average message rate of 10k qps, so that this list would be exhausted in 50s.
These numbers are arbitrary - using a number that is too small would cause churn by closing and recreating partition consumers unnecessarily

Copy link
Member

Choose a reason for hiding this comment

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

having some explanation of the default value in the comment would be good.

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps it's something we can tweak at runtime?

@vprithvi vprithvi changed the title Use bounded list for offset manager [WIP] Use bounded list for offset manager Sep 12, 2019
@vprithvi vprithvi force-pushed the use-bounded-list branch 2 times, most recently from f7a7ca4 to 57b37ae Compare September 16, 2019 16:55
resolves jaegertracing#1109

Signed-off-by: Prithvi Raj <p.r@uber.com>
@vprithvi vprithvi changed the title [WIP] Use bounded list for offset manager Use bounded list for offset manager Sep 16, 2019
Signed-off-by: Prithvi Raj <p.r@uber.com>
Copy link
Member

@yurishkuro yurishkuro left a comment

Choose a reason for hiding this comment

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

not clear on the design for this change, and some implementation details.

concurrent_list stores non-consecutive offsets, right? So 'capacity' is kind of misleading as a control knob, since it doesn't correlate with the number of messages outstanding

let's discuss offline

@@ -43,7 +43,7 @@ func (d *comittingProcessor) Process(message processor.Message) error {
if msg, ok := message.(Message); ok {
err := d.processor.Process(message)
if err == nil {
d.marker.MarkOffset(msg.Offset())
return d.marker.MarkOffset(msg.Offset())
Copy link
Member

Choose a reason for hiding this comment

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

if an error is returned here, will the message be re-processed?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No, it should not be. If an error is thrown here, the number of retries have already been exhausted.

@@ -43,7 +43,7 @@ func (d *comittingProcessor) Process(message processor.Message) error {
if msg, ok := message.(Message); ok {
err := d.processor.Process(message)
if err == nil {
Copy link
Member

Choose a reason for hiding this comment

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

nit: switch to more idiomatic

if err != nil {
  return err
}
return d.marker.MarkOffset(msg.Offset())

cmd/ingester/app/consumer/consumer.go Show resolved Hide resolved
@@ -149,11 +150,17 @@ func (c *Consumer) handleMessages(pc sc.PartitionConsumer) {
defer msgProcessor.Close()
}

msgProcessor.Process(&saramaMessageWrapper{msg})
msgProcessor.Process(&saramaMessageWrapper{msg}, func(message processor.Message, e error) {
msgErrors <- e
Copy link
Member

Choose a reason for hiding this comment

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

is the callback func() only called on error? If it can be called on success, then we should check for err != nil.

nit: s/e/err/

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The callback is only called onError

cmd/ingester/app/processor/parallel_processor.go Outdated Show resolved Hide resolved
Signed-off-by: Prithvi Raj <p.r@uber.com>
@vprithvi vprithvi closed this Nov 11, 2019
@yurishkuro
Copy link
Member

we're considering a different solution

@vprithvi vprithvi deleted the use-bounded-list branch December 2, 2022 15:25
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.

Use a bounded list for offset manager
4 participants