Skip to content

Conversation

@afterincomparableyum
Copy link

This PR implements retry support for createReader failures in the C++ client, matching the behavior of the Java implementation. The implementation includes:

  • Added configuration properties:

    • clientFetchMaxRetriesForEachReplica (default: 3)
    • dataIoRetryWait (default: 5s)
    • clientPushReplicateEnabled (default: false)
  • Added peer location support methods to PartitionLocation:

    • hasPeer() - Check if location has a peer replica
    • getPeer() - Get the peer location
    • hostAndFetchPort() - Get host:port string for logging
  • Implemented retry logic in createReaderWithRetry():

    • Retries up to fetchChunkMaxRetry_ times (doubled if replication enabled)[which is why I added this parameter in this PR]
    • Switches to peer location on failure when available
    • Sleeps between retries when both replicas tried or no peer exists
    • Resets retry counter when moving to new location or on success
  • Added unit tests for new functionality

How was this patch tested?

Unit tests and compiling

@afterincomparableyum
Copy link
Author

@HolyLow @SteNicholas @FMX @RexXiong Could you please help review this PR? Appreciate your help in improving this as needed!

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant