AmatyaAvadhanula opened a new pull request, #15589:
URL: https://github.com/apache/druid/pull/15589

   When a segment of a requested segment granularity cannot be allocated due to 
conflicting segments, we try to exhaust all finer granularity segments before 
giving up.
   However when the preferred granularity is month or coarser, and a week 
granular segment is allocated to adjust with the conflict, the cluster can end 
up in a bad state because a week granular segment doesn't necessarily align 
with the end of the month or higher granular interval.
   To prevent this problem, we consider day granular segments after month in 
the sequence.
   Weekly segments are skipped and are not allocated unless explicitly 
requested for.
   
   Suppose an hour segment exists for 16th December, 2023 from 12am-1am, and a 
new segment needs to be allocated for the timestamp 18th December. After this 
patch:
   1. If the requested granularity is WEEK, create a week granular segment with 
the interval [2023-12-18/2023-12-25].
   2. If the requested granularity is MONTH
     A. A MONTH granular segment cannot be created as a segment already exists 
for the month which doesn't span the whole month.
     B. A DAY segment (and not a WEEK) is chosen from [2023-12-18/2023-12-19] 
and created as it is the next valid granularity and has no conflicts.
   
   
   This PR has:
   
   - [ ] 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.
   - [ ] a release note entry in the PR description.
   - [ ] 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)
   - [ ] added comments explaining the "why" and the intent of the code 
wherever would not be obvious for an unfamiliar reader.
   - [ ] 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.
   - [ ] added integration tests.
   - [ ] 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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to