Skip to content

RATIS-2681. Add a gRPC peer data transfer listener - #1577

Open
HTHou wants to merge 1 commit into
apache:masterfrom
HTHou:codex/RATIS-2681
Open

RATIS-2681. Add a gRPC peer data transfer listener#1577
HTHou wants to merge 1 commit into
apache:masterfrom
HTHou:codex/RATIS-2681

Conversation

@HTHou

@HTHou HTHou commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Add an optional Consumer<GrpcDataTransferEvent> for observing sender-side outcomes of gRPC peer data transfers.

The listener reports:

  • timestamp
  • source and destination RaftPeerId
  • protection method (TLS or NONE)
  • result (SUCCESS or FAILURE)
  • the original error for failures

Events are emitted for AppendEntries requests containing state machine entries and for logical InstallSnapshot transfers. Heartbeats, configuration-only appends, and snapshot notification-only requests are excluded. Listener exceptions are isolated from the replication path, and the listener is documented as non-blocking.

What is the link to the Apache JIRA

https://issues.apache.org/jira/browse/RATIS-2681

How was this patch tested?

  • ./mvnw -pl ratis-test -am -Dtest=TestGrpcDataTransferEventListener -DfailIfNoTests=false test
  • ./mvnw -pl ratis-grpc -am -DskipTests compile checkstyle:check
  • ./mvnw -pl ratis-grpc,ratis-test -am -DskipTests apache-rat:check
  • ./mvnw -pl ratis-grpc -am -DskipTests -Djacoco.skip test-compile spotbugs:check

The tests cover plaintext and TLS append success, append failure and retry, listener exception isolation, one failure event per failed attempt, and successful snapshot transfer to a newly added peer.

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.

1 participant