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(consumer): Remove parallel collect option #3555

Merged
merged 6 commits into from
Jan 4, 2023

Conversation

lynnagara
Copy link
Member

@lynnagara lynnagara commented Dec 22, 2022

It is always better to use parallel collect rather than collect in Snuba consumers. It was already the default. Let's simplify and just remove the option (that was never used anyway).

This change depends on #3547

…tistorage consumer

The KafkaConusmerStrategyFactory is supposed to get deprecated. This stops using it
in the multistorage consumer and removes the need for the generic `ConsumerStrategyFactory`
which takes a MultistorageKafkaPayload instead of a KafkaPayload.

Soon we will be adding a new processing step for payload decoding and schema validation - this
will happen between the DLQ and the rest of the message processing steps.

This change will make it easier to introduce the decoder/validator as it needs to happen
in different places in the main consumer vs the multistorage consumer.
It is always better to use parallel collect rather than collect in Snuba consumers.
It was already the default. Let's simplify and just remove the option.
@lynnagara lynnagara requested a review from a team as a code owner December 22, 2022 00:42
@codecov-commenter
Copy link

codecov-commenter commented Dec 22, 2022

Codecov Report

Base: 92.23% // Head: 92.22% // Decreases project coverage by -0.00% ⚠️

Coverage data is based on head (60ff0f6) compared to base (a55a477).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3555      +/-   ##
==========================================
- Coverage   92.23%   92.22%   -0.01%     
==========================================
  Files         724      724              
  Lines       33789    33782       -7     
==========================================
- Hits        31164    31156       -8     
- Misses       2625     2626       +1     
Impacted Files Coverage Δ
snuba/cli/consumer.py 94.44% <ø> (-0.11%) ⬇️
snuba/cli/multistorage_consumer.py 0.00% <ø> (ø)
snuba/consumers/consumer_builder.py 92.59% <ø> (-0.07%) ⬇️
tests/test_consumer.py 100.00% <ø> (ø)
snuba/consumers/consumer.py 85.54% <100.00%> (-0.09%) ⬇️
snuba/consumers/strategy_factory.py 79.59% <100.00%> (-0.81%) ⬇️
snuba/state/cache/redis/backend.py 95.09% <0.00%> (-1.97%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

CommitOffsets(commit),
self.__max_batch_size,
self.__max_batch_time,
10.0,
Copy link
Contributor

@onewland onewland Dec 22, 2022

Choose a reason for hiding this comment

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

nit: the meaning of 10.0 is is not super clear in this call. could we do one of:

  1. use named arguments rather than positional here
  2. make a named constant of DEFAULT_PARALLEL_COLLECT_TIMEOUT_MS = 10.0

in general I think named over positional is better when the argument count is > 3. It would be easy to transpose self.__max_batch_time and DEFAULT_PARALLEL_COLLECT_TIMEOUT_MS, right (same type)?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to a named argument. The 10.0 value for the timeout actually happens to be the default in Arroyo so another option could've been to omit it. But it's probably not a bad idea to be explicit about it here.

Base automatically changed from ref-multistorage-consumer to master January 3, 2023 21:46
@lynnagara lynnagara merged commit 6917371 into master Jan 4, 2023
@lynnagara lynnagara deleted the remove-parallel-collect-option branch January 4, 2023 01:38
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.

5 participants