AmatyaAvadhanula opened a new pull request, #15682: URL: https://github.com/apache/druid/pull/15682
**Changes:** 1) When a task lock posse is created, add the task to it immediately. This would help avoid leaving behind phantom posses without associated tasks. This helps simplify changes made as part of https://github.com/apache/druid/pull/14966. A task posse could be created but the task may not be associated with it due to failures during segment allocation etc. This can leave behind an empty posse associated with a phantom lock that can block ingestion. The workaround was to restart the overlord. The change made in this PR associates the task with its requested posse immediately and will help the task lockbox to clean it up when `unlock` is called. 2) When an appending task lock is acquired by a task, check if any of the conflicting locks is superseded by it. If yes, unlock the unneeded old locks associated with the task. Consider an appending lock acquired for an hour granularity by a streaming task with concurrent append and replace. If a concurrent replacing task increments the version of the segments and changes the granularity from hour to day, the next allocation from the task for the same timestamp would create a day lock which supersedes the existing hour lock. If both the locks are associated with the task, this can lead to the transaction append action to fail because of an invalid state of the locks. The change in this PR would prevent such a state from occurring. 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. - [ ] 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) - [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. - [ ] 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]
