kfaraz opened a new pull request, #13074:
URL: https://github.com/apache/druid/pull/13074
Fixes #12822
### Description
This PR adds the changes required for the simulation framework discussed in
the above proposal.
The framework makes it easy to write tests that simulate coordinator
behaviour under various
conditions. Some of the things that are made possible by the changes are:
- have any complicated cluster setup
- easily create and assign a large number of segments of varying
granularities, sizes, etc.
to the servers
- full control of the following during the course of the simulation
- cluster: add, kill servers
- segments: create, load, delete
- load rules of a datasource
- inventory view maintained by the coordinator: synchronize
- metrics emitted by the coordinator
- minimal mocking in the sim environment and no additional mocking for
writing a new test
### Changes:
The changes here are slightly different from what was proposed, mostly in
terms of how each coordinator cycle is invoked.
Main classes
- Add `CoordinatorSimulation` and related interfaces to dictate behaviour of
simulation
- Add `CoordinatorSimulationImpl` as a concrete implementation
- Add `CoordinatorSimulationBaseTest`, `SegmentBalancingTest`
- Add `BlockingExecutorService`
Provide mocked dependencies to the `DruidCoordinator` for:
- JacksonConfigManager
- LookupCoordinatorManager
Provide test dependencies to the `DruidCoordinator` for:
- `SegmentsMetadataManager`: keeps a list of used segments in memory
- `HttpClient`: used for sending segment load requests to respective
historicals.
The test impl here processes each request and updates the server state
but not
the inventory view maintained by the coordinator.
- `MetadataRuleManager`: keeps rules in memory and allows for update during
simulation
- `ServerInventoryView`: allows synchronization with the current cluster
state in the sim
Some of these test dependencies can later be consolidated with existing
utility classes.
### Pending changes in this PR:
- Populate the remaining test cases in `SegmentBalancingTest` and
`SegmentLoadingTest`
- Each of these test cases represents a bullet discussed in #12881
and will initially be disabled until #12881 is fixed
<hr>
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.
- [ ] 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]