Skip to content

Fix IoTConsensus SyncLog retry handling - #18317

Open
jt2594838 wants to merge 4 commits into
apache:masterfrom
jt2594838:add_retry_for_iotv1_error
Open

Fix IoTConsensus SyncLog retry handling#18317
jt2594838 wants to merge 4 commits into
apache:masterfrom
jt2594838:add_retry_for_iotv1_error

Conversation

@jt2594838

Copy link
Copy Markdown
Contributor

Description

Fix interrupted follower SyncLog handling

  • Remove an interrupted request from SyncLogCacheQueue instead of applying it unconditionally.
  • Preserve the thread interrupt flag and return an INTERNAL_SERVER_ERROR status with a clear message so the leader can retry.

Retry WRITE_PROCESS_ERROR

  • Treat WRITE_PROCESS_ERROR as retriable in RetryUtils.needRetryForWrite.
  • This covers SyncLog statuses produced by transient follower write failures such as IO failures in delete, WAL, MemTable, or TsFileProcessor paths.

Tests

  • Added coverage ensuring interrupted SyncLog requests are not applied.
  • Added coverage ensuring a follower WRITE_PROCESS_ERROR causes the leader to retry and eventually apply the request.
  • Added direct unit coverage for the retry-status classification.
  • Verified with:
    • mvn test -pl iotdb-core/consensus -am -Dtest=RetryUtilsTest,ReplicateTest#syncLogWriteProcessErrorTriggersLeaderRetryTest -Dsurefire.failIfNoSpecifiedTests=false
    • mvn test -pl iotdb-core/consensus -Dtest=ReplicateTest#syncLogInterruptedWhileWaitingTest
    • Chinese locale test compilation for the consensus module.

This PR has:

  • been self-reviewed.
    • concurrent write
  • added comments explaining the intent of the code.
  • added unit tests or modified existing tests to cover new code paths.

Key changed/added classes
  • IoTConsensusServerImpl
  • RetryUtils
  • ReplicateTest
  • RetryUtilsTest

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants