You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "abhishekrb19 (via GitHub)" <gi...@apache.org> on 2024/03/18 05:23:53 UTC

[PR] Fix validation of markUsed and markUnused APIs (druid)

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

   ### Description:
   Before this patch, `isValid()` treated empty segment IDs inconsistently.  Consider the following scenarios with each parameter to `markUsed` and `markUnused` APIs and their outcomes:
   
   1. Interval = null & segment IDs = null: Invalid
   2. Interval = non-null & segment IDs = []: Invalid
   3. Interval = non-null & segment IDs = null: Valid
   4. Interval = null & segment IDs = []: Invalid
   
   Note that in scenario 2, empty segment IDs are treated as the existence of the parameter. On the other hand, in scenario 4, empty segment IDs are treated as the absence of the parameter, which is confusing from an API user's perspective. 
   
   ### Fix:
   With this patch, empty segment IDs are treated the same as null, indicating the absence of the parameter. So the outcome of scenario 2 will be Valid.
   
   Added unit tests for the missing scenarios and updated the expectations of a couple of existing unit tests.
   
   This PR has:
   
   - [x] been self-reviewed.
   - [x] a release note entry in the PR description.
   - [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] 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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org


Re: [PR] Fix validation of empty segment IDs in `markUsed` and `markUnused` APIs (druid)

Posted by "abhishekrb19 (via GitHub)" <gi...@apache.org>.
abhishekrb19 merged PR #16145:
URL: https://github.com/apache/druid/pull/16145


-- 
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: commits-unsubscribe@druid.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org