maytasm opened a new pull request #11009:
URL: https://github.com/apache/druid/pull/11009
Auto-compaction with segment granularity should skip segments that already
have the configured segmentGranularity
### Description
Auto-compaction now supports setting SegmentGranularity. However, it
currently submits compaction tasks unnecessary for segments that was compacted
(lastCompactionState != null) but lastCompactionState.getGranularitySpec() ==
null (i.e. compacted when the auto compaction spec does not set
SegmentGranularity) and the segments' SegmentGranularity is already the same as
the SegmentGranularity configured in the auto compaction spec. This change will
make auto compaction checks the existing segments' SegmentGranularity and
determine if compaction is needed or not even when SegmentGranularity is not
stored in lastCompactionState.
Note that, with this change, we actually never need to check
SegmentGranularity in lastCompactionState to determine if segments need
compaction or not. However, I still keep that check there for the following
reasons:
1) If lastCompactionState has SegmentGranularity, then it is faster to check
and compare using that.
2) If we add support for queryGranularity, we will need to check it in
lastCompactionState
This PR has:
- [x] been self-reviewed.
- [ ] using the [concurrency
checklist](https://github.com/apache/druid/blob/master/dev/code-review/concurrency.md)
(Remove this item if the PR doesn't have any relation to concurrency.)
- [ ] added documentation for new or modified features or behaviors.
- [x] added Javadocs for most classes and all non-trivial methods. Linked
related entities via Javadoc links.
- [ ] added or updated version, license, or notice information in
[licenses.yaml](https://github.com/apache/druid/blob/master/dev/license.md)
- [x] added comments explaining the "why" and the intent of the code
wherever would not be obvious for an unfamiliar reader.
- [x] added unit tests or modified existing tests to cover new code paths,
ensuring the threshold for [code
coverage](https://github.com/apache/druid/blob/master/dev/code-review/code-coverage.md)
is met.
- [x] added integration tests.
- [x] been tested in a test Druid cluster.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]