dajac opened a new pull request, #24150:
URL: https://github.com/apache/kafka/pull/24150

   The unit tests of the consumer group protocol check the async
   consumer's membership manager and the group coordinator separately,
   each against mocks, and the integration tests cannot control when
   requests arrive or when faults happen.
   
   This patch adds a deterministic simulation that runs the async
   consumer's request managers and membership manager against the group
   coordinator shard. The simulation controls the clock, the network,
   the coordinator log and the faults, and checks invariants after every
   step. A seed determines the whole run.
   
   Changes:
   - `SimConsumer` (clients test fixtures) builds the request managers,
     the `ApplicationEventProcessor` and the `NetworkClientDelegate` as
     `AsyncKafkaConsumer` does, over a `MockClient`, and steps them with
     `ConsumerNetworkThread#runOnce`. Its application thread is modeled
     after `AsyncKafkaConsumer`: `poll`, `subscribe`, `unsubscribe`,
     `commitSync`, `commitAsync` and `close`.
   - `HeartbeatSimCoordinator` runs a `GroupCoordinatorShard` and its
     `CoordinatorTimerImpl` under a model of `CoordinatorRuntime`:
     operations complete when the high watermark passes their batch,
     failed appends revert the state, writes time out, and failovers
     truncate the uncommitted batches.
   - `HeartbeatSimulation` holds the scheduler, a network with one
     ordered connection per client and broker, the workload, the faults,
     the invariants and the convergence check.
   - `HeartbeatSimulationTest` runs random seeds and checks that a seed
     reproduces its run. `HeartbeatFaultExplorationTest` runs every
     placement of a fault in three scripted scenarios. Both tolerate the
     violations of the issues in `HeartbeatSimulation#KNOWN_ISSUES` and
     fail on any other.
   - `HeartbeatScenariosTest` reproduces those issues, one test each.
     The tests are disabled until the issues are fixed.
   - The `heartbeat.sim.*` project properties configure the runs, e.g.
     `./gradlew :group-coordinator:test --tests HeartbeatSimulationTest
     -Pheartbeat.sim.seeds=5000`.
   


-- 
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]

Reply via email to