Caideyipi opened a new pull request, #18323:
URL: https://github.com/apache/iotdb/pull/18323

   ## Description
   
   ### Regression coverage for #18317
   
   This PR adds a deterministic unit test for the SyncLog ordering regression 
introduced by #18317.
   
   When a batch contains sync indexes `[1, 2]`, index 1 returns 
`WRITE_PROCESS_ERROR` once, and index 2 succeeds, `DispatchLogHandler` retries 
the whole batch. The follower has already applied index 2, so the first 
successful application order becomes `[2, 1]` instead of `[1, 2]`. This can 
change the result of non-commutative operations.
   
   The test simulates the whole-batch leader retry and records each sync index 
when it first succeeds.
   
   This is intentionally a reproducer-only PR: the new test currently fails on 
`master` and should be paired with a production fix before merge.
   
   ### Reproduction
   
   ```shell
   ./mvnw test -pl iotdb-core/consensus -am 
-Dtest=ReplicateTest#syncLogWriteProcessErrorRetryPreservesRequestOrderTest 
-Dsurefire.failIfNoSpecifiedTests=false
   ```
   
   Current result:
   
   ```text
   expected:<[1, 2]> but was:<[2, 1]>
   ```
   
   Related review: 
https://github.com/apache/iotdb/pull/18317#pullrequestreview-4793334873
   
   <hr>
   
   This PR has:
   - [x] been self-reviewed.
   - [x] added unit tests to cover the regression.
   
   <hr>
   
   ##### Key changed/added classes
   
   - `ReplicateTest`


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