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

Support segmentNamePostfix in segment name #7646

Merged
merged 1 commit into from
Oct 28, 2021

Conversation

jackjlli
Copy link
Member

Description

This PR supports segmentNamePostfix in segment name in NormalizedDateSegmentNameGenerator class.

Upgrade Notes

Does this PR prevent a zero down-time upgrade? (Assume upgrade order: Controller, Broker, Server, Minion)

  • Yes (Please label as backward-incompat, and complete the section below on Release Notes)

Does this PR fix a zero-downtime upgrade introduced earlier?

  • Yes (Please label this as backward-incompat, and complete the section below on Release Notes)

Does this PR otherwise need attention when creating release notes? Things to consider:

  • New configuration options
  • Deprecation of configurations
  • Signature changes to public methods/interfaces
  • New plugins added or old plugins removed
  • Yes (Please label this PR as release-notes and complete the section on Release Notes)

Release Notes

Documentation

@jackjlli jackjlli requested a review from snleee October 27, 2021 17:14
@@ -165,7 +165,8 @@ public void setup(Context context)
new NormalizedDateSegmentNameGenerator(_rawTableName, _jobConf.get(JobConfigConstants.SEGMENT_NAME_PREFIX),
_jobConf.getBoolean(JobConfigConstants.EXCLUDE_SEQUENCE_ID, false),
IngestionConfigUtils.getBatchSegmentIngestionType(_tableConfig),
IngestionConfigUtils.getBatchSegmentIngestionFrequency(_tableConfig), dateTimeFormatSpec);
IngestionConfigUtils.getBatchSegmentIngestionFrequency(_tableConfig), dateTimeFormatSpec,
_jobConf.get(JobConfigConstants.SEGMENT_NAME_POSTFIX));
Copy link
Contributor

Choose a reason for hiding this comment

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

Would this same change need to be made in v0_deprecated/pinot-spark, pinot-batch-ingestion-common, the local support, and other places where new NormalizedDateSegmentNameGenerator() is called?

Copy link
Member Author

@jackjlli jackjlli Oct 27, 2021

Choose a reason for hiding this comment

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

That's actually a very good idea, while not every caller provides the postfix config. That's why I initially introduced a new constructor that keeps the same behavior as it is. Will apply the changes to those classes in the next push.

@codecov-commenter
Copy link

codecov-commenter commented Oct 27, 2021

Codecov Report

Merging #7646 (3b99468) into master (0166135) will decrease coverage by 0.06%.
The diff coverage is 40.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##             master    #7646      +/-   ##
============================================
- Coverage     71.75%   71.68%   -0.07%     
- Complexity     3997     3999       +2     
============================================
  Files          1576     1576              
  Lines         79966    79971       +5     
  Branches      11843    11844       +1     
============================================
- Hits          57377    57328      -49     
- Misses        18730    18776      +46     
- Partials       3859     3867       +8     
Flag Coverage Δ
integration1 29.09% <0.00%> (-0.29%) ⬇️
integration2 27.72% <0.00%> (+0.05%) ⬆️
unittests1 68.72% <50.00%> (+0.01%) ⬆️
unittests2 14.59% <0.00%> (-0.04%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...tion/batch/common/SegmentGenerationTaskRunner.java 60.65% <0.00%> (-1.02%) ⬇️
...ache/pinot/segment/local/utils/IngestionUtils.java 19.13% <0.00%> (-0.12%) ⬇️
...eator/name/NormalizedDateSegmentNameGenerator.java 88.23% <60.00%> (-3.44%) ⬇️
.../spi/creator/name/SegmentNameGeneratorFactory.java 57.89% <100.00%> (ø)
...data/manager/realtime/SegmentCommitterFactory.java 64.70% <0.00%> (-29.42%) ⬇️
...pinot/common/utils/fetcher/HttpSegmentFetcher.java 69.23% <0.00%> (-10.26%) ⬇️
...er/api/resources/LLCSegmentCompletionHandlers.java 53.46% <0.00%> (-8.92%) ⬇️
...altime/ServerSegmentCompletionProtocolHandler.java 49.52% <0.00%> (-8.58%) ⬇️
...e/data/manager/realtime/SplitSegmentCommitter.java 53.84% <0.00%> (-7.70%) ⬇️
...r/helix/SegmentOnlineOfflineStateModelFactory.java 58.49% <0.00%> (-6.61%) ⬇️
... and 22 more

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 0166135...3b99468. Read the comment docs.

@jtao15
Copy link
Contributor

jtao15 commented Oct 27, 2021

This remind me of merge/roll-up tasks, we put merged_mergeLevel_timestamp_taskIndex_rawTableName as the prefix. Maybe it's cleaner to move the timestamp in postfix and we can updated it once this pr is merged.

@jackjlli
Copy link
Member Author

This remind me of merge/roll-up tasks, we put merged_mergeLevel_timestamp_taskIndex_rawTableName as the prefix. Maybe it's cleaner to move the timestamp in postfix and we can updated it once this pr is merged.

+1 on that. It's not a good idea to put timestamp as the prefix as segment names are listed in alphanumeric order.

@jackjlli jackjlli force-pushed the support-segmentNamePostfix-in-segment-name branch from 70c1d2b to 3b99468 Compare October 27, 2021 17:53

public NormalizedDateSegmentNameGenerator(String tableName, @Nullable String segmentNamePrefix,
boolean excludeSequenceId, @Nullable String pushType, @Nullable String pushFrequency,
@Nullable DateTimeFormatSpec dateTimeFormatSpec) {
@Nullable DateTimeFormatSpec dateTimeFormatSpec, @Nullable String segmentNamePostfix) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we create a new constructor to make the class backward compatible? This change will break the external code that depends on this class (i.e. our internal offline push flow).

I'm personally fine with keeping this way as long as you make sure to update the external code accordingly.

Copy link
Member Author

Choose a reason for hiding this comment

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

The external code has to adopt the new constructor in order to accept segmentNamePostfix as a parameter, so either way the external code has to be changed. We should be good here.

@jackjlli jackjlli merged commit 611f3b1 into master Oct 28, 2021
@jackjlli jackjlli deleted the support-segmentNamePostfix-in-segment-name branch October 28, 2021 17:54
@snleee
Copy link
Contributor

snleee commented Nov 22, 2021

#7813

kriti-sc pushed a commit to kriti-sc/incubator-pinot that referenced this pull request Dec 12, 2021
Co-authored-by: Jack Li(Analytics Engineering) <jlli@jlli-mn1.linkedin.biz>
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