jihoonson opened a new pull request #10033: URL: https://github.com/apache/druid/pull/10033
Fixes https://github.com/apache/druid/issues/9352. ### Description This PR is implemented on top of https://github.com/apache/druid/pull/10025. This PR allows appending to existing datasources if the appended segments are partitioned using the `dynamic` partitionsSpec. The main change is found in `IndexerSQLMetadataStorageCoordinator`, which used to return null in `createNewSegment()` if the partitionsSpec is not compatible. It now allows segments to have mixed types of shardSpecs and finds the proper partitionId using a new method `ShardSpec.sharePartitionSpace()`. Most of the changes are new unit tests to verify the behavior. The added tests include - tuningConfig test: allow only dynamic if appendToExisting = true - Append test - With time chunk lock - Append dynamically partitioned segments to a dynamically partitioned datasource - Append dynamically partitioned segments to a hash-partitioned datasource - Append dynamically partitioned segments to a range-partitioned datasource - Compact segments of mixed shardSpecs - With segment lock - Append dynamically partitioned segments to a dynamically partitioned datasource - Overwrite a datasource with segment lock and append dynamically partitioned segments - Compact a subset of segments of mixed shardSpecs in each time chunk Integration tests are still missing, I will add them in a follow-up pr. <hr> 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/licenses.yaml) - [ ] 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. <hr> ##### Key changed/added classes in this PR * `IndexerSQLMetadataStorageCoordinator` * `ShardSpec` ---------------------------------------------------------------- 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]
