You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ratis.apache.org by wi...@apache.org on 2024/05/16 02:59:27 UTC

(ratis) branch snapshot-3 updated (a6a21d5a0 -> 21f25926e)

This is an automated email from the ASF dual-hosted git repository.

williamsong pushed a change to branch snapshot-3
in repository https://gitbox.apache.org/repos/asf/ratis.git


 discard a6a21d5a0 update snapshot version
 discard 8eafc4f9f RATIS-2056. Update purge index when snapshot installed. (#1065)
 discard 3e3013b8a RATIS-2052. Add docs for triggering snapshot when removing raftGroup parameter. (#1061)
 discard 52e8db697 RATIS-2050. Add creationGap param to snapshot management API (#1058)
 discard cda87cee9 RATIS-2049. Suppress Sonar warning for volatile objects (#1057)
 discard 21271d600 RATIS-2036. Avoid trigger snapshot when removing raftGroup (#1055)
 discard ba6e1604d RATIS-2048. Fix SimpleStateMachineStorage potential NPE exception (#1056)
 discard 50a5f18a0 RATIS-2047. Avoid unnecessary warn log when creating raft group (#1054)
 discard d2e114eda RATIS-2044. Fix ReadIndex loss caused by data race in AppendEntriesListeners (#1052)
 discard 5bb9e32e3 RATIS-2019 Fixed abnormal exit of StateMachineUpdater (#1033)
 discard 5baff19ff RATIS-2017: checkAndEvictCache must be done in writeLock. (#1031)
 discard f8f12d890 RATIS-2008. Follower should recognize candidate if the candidate is the same peer as the current valid leader (#1024)
 discard 1691a3c0f RATIS-2012. Client should not retry after close. (#1025)
 discard cc038aea9 RATIS-2013. OrderedAsync retry results an IllegalStateException in GrpcClientProtocolService. (#1026)
    omit e6f255461 Change version for the version 3.0.1 -rc0
     add 77bf12917 RATIS-1984. Simplify Maven cache for dependencies in CI (#999)
     add ec8efec48 RATIS-1985. Calculate code coverage (#1000)
     add 93f46d940 RATIS-1986. Intermittent failure in TestRaftStorage#testSnapshotCleanup (#1001)
     add c2dacbd01 RATIS-1988. Provide Jacoco report to Sonar (#1002)
     add 256fc2a51 RATIS-1991. Optimize the reconfig judgment logic in the ReconfigurationBase class. (#1004)
     add 43a02109d RATIS-1983. Refactor client request processing to support reference count. (#998)
     add 5e8ef17e7 RATIS-1994. AsyncApi send() to support optional replication level. (#1006)
     add 84285d3ea RATIS-1925. Support Zero-Copy in GrpcClientProtocolService (#1007)
     add 59dfd3549 RATIS-1998. Add watch request metrics (#1009)
     add 206205810 RATIS-1989. Intermittent timeout in TestStreamObserverWithTimeout (#1012)
     add 863c2e8a0 RATIS-1987. Intermittent NPE in TestGrpcZeroCopy. (#1013)
     add 6671ef683 RATIS-1999. Move RaftServerJmxAdapter out from RaftServerImpl. (#1010)
     add 24482561f RATIS-2001. TransactionContext can be wrongly reused. (#1015)
     add eae0d18eb RATIS-2005. Fix URF_UNREAD_FIELD in MetricServerCallListener (#1018)
     add 859a41074 RATIS-2006. Fix DM_EXIT in filestore Client (#1019)
     add 14eb0bf05 RATIS-2002. Fix findbugs warnings in LogSegmentPath (#1017)
     add 5d4ec6933 RATIS-1990. Refactor appendEntries processing to support reference count (#1011)
     add 82f7b3b85 RATIS-2003. Fix IT_NO_SUCH_ELEMENT in InstallSnapshotRequests (#1016)
     add fc5c72560 RATIS-2004. Fix EQ_COMPARETO_USE_OBJECT_EQUALS in LogSegment (#1020)
     add 82c31eaf3 RATIS-2009. ReferenceCount should work for all LogEntry types. (#1021)
     add d459eb61c RATIS-1934. Support Zero-Copy in GrpcServerProtocolService (#1014)
     add 561cd6d48 RATIS-2010. Remove dependency on spotbugs-annotations (#1022)
     add c1e0ec284 RATIS-2013. OrderedAsync retry results an IllegalStateException in GrpcClientProtocolService. (#1026)
     add 0e247578b RATIS-1972. Add junit 5 dependencies in ratis-server. (#1003)
     add ea1341b05 RATIS-2012. Client should not retry after close. (#1025)
     add 79923c2d7 RATIS-2008. Follower should recognize candidate if the candidate is the same peer as the current valid leader (#1024)
     add e2aaddca9 RATIS-2007. Zero-copy buffers are not released (#1027)
     add a18d08c89 RATIS-2015. Node.js 16 actions are deprecated (#1028)
     add 5560718ab RATIS-2011. When a log entry is truncated, remove TransactionContext. (#1029)
     add 7d587ec03 RATIS-2017: checkAndEvictCache must be done in writeLock. (#1031)
     add 035cd968f RATIS-2016. Correct NotificationInstallSnapshot's index (#1030)
     add 9cd74a21d RATIS-1974. Migrate ratis-metrics-default tests to Junit 5 (#1034)
     add c4b10faa8 RATIS-2018. Zero-copy buffers are not released - 2nd chunk (#1032)
     add cf897f029 RATIS-1973. Migrate ratis-examples tests to Junit 5. (#1035)
     add d2f1c57fe RATIS-2019 Fixed abnormal exit of StateMachineUpdater (#1033)
     add c46da2213 RATIS-1978. Add tests assertions to verify all zero-copy messages are released properly (#1023)
     add a2cb49e8c RATIS-1975. Migrate ratis-metrics-dropwizard3 tests to Junit 5. (#1037)
     add e44de2662 RATIS-1976. Migrate ratis-test tests to Junit 5 - Part 1 (#1038)
     add 4f5612fd8 RATIS-2023. Remove duplicate RefCountingMap (#1039)
     add 775b286c4 RATIS-1997. Refactor StateMachine interface to use ReferenceCountedObject (#1036)
     add 1d99921ef RATIS-2024. Refactor appendEntries code. (#1040)
     add 16b6536e2 RATIS-2025. Move out assert and proto methods from RaftServerImpl. (#1041)
     add 67b76509d RATIS-2021. Migrate ratis-test tests to Junit 5 - Part 2. (#1043)
     add 044b111d9 RATIS-2027. Ratis Streaming: Remote Stream copy data to heap. (#1044)
     add 53d35c01e RATIS-2020. Refactor TransactionContext to supply LogEntryProto via a ReferenceCountedObject (#1042)
     add 1bd451046 RATIS-2038. IllegalStateException when ServerState is closed before start. (#1048)
     add df436c73f RATIS-2035. Refactor streaming code for Read. (#1046)
     add 99a833c29 Ratis-2031. Add peer info to response of GroupInfoCommand CLI (#1047)
     add e199daaf2 RATIS-2028. Refactor RaftLog to supply log as ReferenceCountedObject (#1045)
     add 422cb9d4c RATIS-2043. Change toString() of RaftConfigurationImpl (#1051)
     add 44a4f1fb7 RATIS-2044. Fix ReadIndex loss caused by data race in AppendEntriesListeners (#1052)
     add 72c060d9c RATIS-2045. SnapshotInstallationHandler doesn't notify follower when snapshotIndex is -1 and firstAvailableLogIndex is 0 (#1053)
     add c3d615b4f RATIS-2047. Avoid unnecessary warn log when creating raft group (#1054)
     add be497d5c4 RATIS-2048. Fix SimpleStateMachineStorage potential NPE exception (#1056)
     add 0f631fef4 RATIS-2036. Avoid trigger snapshot when removing raftGroup (#1055)
     add 54c2b1f7f RATIS-2049. Suppress Sonar warning for volatile objects (#1057)
     add 14dbbf3d7 RATIS-2050. Add creationGap param to snapshot management API (#1058)
     add 397c2efdd RATIS-2026. LogAppender to consume log entries with reference count (#1049)
     add a99e709fe RATIS-2052. Add docs for triggering snapshot when removing raftGroup parameter. (#1061)
     add c73a3eb8c RATIS-1979. Allow StateMachine.read to return a ReferentCountedObject (#1062)
     add f40424422 RATIS-2051. Fix Sonar bugs for Ratis. (#1059)
     add bc6221b32 RATIS-1519. When DataStreamManagement#read an exception occurs, remove DataStream (#596)
     add 8638a2ffa Ratis-2040. Fix RaftPeerId generated by command of "raftMetaConf" to use real PeerId (#1060)
     add 49b400601 RATIS-1504. Add timeout handling to DataStreamManagement#checkSuccessRemoteWrite. (#1064)
     add 8913a999d RATIS-2056. Update purge index when snapshot installed. (#1065)
     add cf9d2292a RATIS-2057. Add back JavaUtils.attemptUntilTrue(..). (#1066)
     add ee09075c0 RATIS-2059. Missing reference count when putting log entries to cache on follower. (#1067)
     add 8704cd23d RATIS-2055. Move notifyTermIndexUpdated after leader.checkReady (#1068)
     add 7f1b1b6be RATIS-2060 Avoid unexpected shutdown of RaftServerProxy during membership change (#1069)
     add b0ec1143c RATIS-2061. Fix setCloseThreshold parameter in RaftServerConfigKeys (#1070)
     add 1fe59e07d RATIS-2065. Avoid the out-of-heap memory OOM phenomenon of frequent creation and deletion of Raft group scenarios. (#1071)
     add 4e3eee7c9 RATIS-2069. RaftMetaConf command sets incorrect peerAddress pattern. (#1075)
     add 51244e42c RATIS-2068. Avoid logging raw StateMachine data body. (#1074)
     add cbd9793a0 RATIS-2070. Skip push build for dependabot (#1077)
     add 6fc42220b RATIS-2071. Bump Bouncy Castle to 1.78.1 (#1076)
     add 58671923e RATIS-2072. Limit timeout of CI workflow jobs (#1078)
     add 839f8fb26 RATIS-2073. Enable Surefire process checkers (#1079)
     add 388852071 RATIS-2067. Enhance content for concept in ratis-docs. (#1073)
     add ac05d64f3 RATIS-2074. Intermittent fork timeout in TestRaftWithNetty#testBasicAppendEntriesKillLeader. (#1080)
     add e17650163 RATIS-2078. Correct timeout unit for tests (#1083)
     add 8c9c801e5 RATIS-2080. Reuse LeaderElection executor. (#1082)
     add da9eee0fb RATIS-2087. Remove workaround for GitHub reverse DNS issue (#1089)
     add 0814b896b RATIS-2086. Autolink Ozone issues in PRs (#1088)
     add 33cb58678 Revert "RATIS-2080. Reuse LeaderElection executor. (#1082)"
     add c10e7bc8d RATIS-2076. Intermittent timeout in TestRaftWithNetty#testWithLoad. (#1090)
     add 7f04919ff RATIS-2077. Timedout StateMachine retainRead is released twice (#1081)
     add 8bc09bbe5 RATIS-2085. Compile Ratis with JDK 17/21 in CI (#1087)
     add 599835dba RATIS-2083. Timer thread leak when log level is DEBUG (#1086)
     add 29bba5943 RATIS-2088. Fix name and imports related check in test-directory (#1092)
     add 192ce4880 RATIS-2090. Bump ratis-thirdparty to 1.0.6 (#1093)
     add c81902a09 RATIS-2066. RaftServerProxy supports close callback (#1072)
     new 2fddd52ae reply ALREADY_INSTALLED
     new 21f25926e latest snapshot version

This update added new revisions after undoing existing revisions.
That is to say, some revisions that were in the old version of the
branch are not in the new version.  This situation occurs
when a user --force pushes a change and generates a repository
containing something like this:

 * -- * -- B -- O -- O -- O   (a6a21d5a0)
            \
             N -- N -- N   refs/heads/snapshot-3 (21f25926e)

You should already have received notification emails for all of the O
revisions, and so the following emails describe only the N revisions
from the common base, B.

Any revisions marked "omit" are not gone; other references still
refer to them.  Any revisions marked "discard" are gone forever.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .asf.yaml                                          |   4 +-
 .github/workflows/post-commit.yml                  | 209 +++---
 .github/workflows/repeat-test.yml                  |  10 +-
 dev-support/checks/build.sh                        |  10 +-
 dev-support/checks/coverage.sh                     |  61 ++
 dev-support/checks/findbugs.sh                     |   6 +
 dev-support/checks/sonar.sh                        |   1 +
 dev-support/checks/unit.sh                         |  12 +-
 pom.xml                                            |  53 +-
 ratis-assembly/pom.xml                             |   2 +-
 ratis-assembly/src/main/resources/NOTICE           |  24 +-
 ratis-client/pom.xml                               |   2 +-
 .../java/org/apache/ratis/client/api/AsyncApi.java |   8 +-
 .../org/apache/ratis/client/impl/AsyncImpl.java    |   4 +-
 .../apache/ratis/client/impl/ClientProtoUtils.java |   4 +-
 .../ratis/client/impl/DataStreamClientImpl.java    |   7 +-
 .../org/apache/ratis/client/impl/OrderedAsync.java |  11 +-
 .../ratis/client/impl/OrderedStreamAsync.java      |   4 +
 ratis-common/pom.xml                               |   9 +-
 .../main/java/org/apache/ratis/conf/ConfUtils.java |   2 +-
 .../org/apache/ratis/conf/ReconfigurationBase.java |   2 +-
 .../datastream/impl}/DataStreamRequestByteBuf.java |   3 +-
 .../org/apache/ratis/protocol/GroupInfoReply.java  |  13 +-
 .../protocol/RaftClientAsynchronousProtocol.java   |  34 +-
 .../apache/ratis/protocol/RaftClientRequest.java   |  92 ++-
 .../java/org/apache/ratis/protocol/RaftPeerId.java |   2 -
 .../java/org/apache/ratis/util/BatchLogger.java    |  12 +-
 .../main/java/org/apache/ratis/util/JavaUtils.java |   3 +-
 .../java/org/apache/ratis/util/JmxRegister.java    |   7 +-
 .../java/org/apache/ratis/util/LeakDetector.java   | 140 ++++
 .../java/org/apache/ratis/util/PeerProxyMap.java   |   1 +
 .../java/org/apache/ratis/util/Preconditions.java  |  11 +
 .../org/apache/ratis/util}/RefCountingMap.java     |  20 +-
 .../ratis/util/ReferenceCountedLeakDetector.java   | 222 +++++++
 .../apache/ratis/util/ReferenceCountedObject.java  | 101 +--
 .../java/org/apache/ratis/util/SlidingWindow.java  |  32 +-
 .../src/test/java/org/apache/ratis/BaseTest.java   |  42 +-
 .../org/apache/ratis/util}/TestRefCountingMap.java |  20 +-
 ratis-docs/pom.xml                                 |   2 +-
 ratis-docs/src/site/markdown/cli.md                |   2 +-
 ratis-docs/src/site/markdown/concept/index.md      |  66 +-
 ratis-docs/src/site/markdown/metrics.md            |  53 +-
 ratis-docs/src/site/markdown/snapshot.md           |   2 +
 ratis-examples/pom.xml                             |  20 +-
 .../arithmetic/ArithmeticStateMachine.java         |   2 +-
 .../counter/server/CounterStateMachine.java        |   2 +-
 .../apache/ratis/examples/filestore/FileInfo.java  |   3 +-
 .../examples/filestore/FileStoreStateMachine.java  |  29 +-
 .../ratis/examples/filestore/cli/Client.java       |   5 +-
 .../ratis/examples/filestore/cli/DataStream.java   |   5 +-
 .../ratis/examples/filestore/cli/LoadGen.java      |   2 +-
 .../java/org/apache/ratis/TestMultiRaftGroup.java  |  27 +-
 .../ratis/examples/ParameterizedBaseTest.java      |  21 +-
 .../ratis/examples/arithmetic/TestArithmetic.java  |  30 +-
 .../examples/arithmetic/TestArithmeticLogDump.java |  24 +-
 .../examples/arithmetic/cli/TestAssignCli.java     |  30 +-
 .../arithmetic/expression/TestExpression.java      |  26 +-
 .../ratis/examples/common/TestSubCommand.java      |  19 +-
 .../apache/ratis/examples/counter/TestCounter.java |  21 +-
 ratis-experiments/pom.xml                          |   2 +-
 ratis-grpc/pom.xml                                 |   9 +-
 .../main/java/org/apache/ratis/grpc/GrpcUtil.java  |  34 +-
 .../apache/ratis/grpc/metrics/ZeroCopyMetrics.java |  73 +++
 .../intercept/server/MetricServerCallListener.java |  43 --
 .../intercept/server/MetricServerInterceptor.java  |   3 +-
 .../grpc/server/GrpcClientProtocolService.java     | 147 +++--
 .../apache/ratis/grpc/server/GrpcLogAppender.java  |  62 +-
 .../grpc/server/GrpcServerProtocolClient.java      |   2 +-
 .../grpc/server/GrpcServerProtocolService.java     | 137 +++-
 .../org/apache/ratis/grpc/server/GrpcService.java  |  18 +-
 .../ratis/grpc/util/StreamObserverWithTimeout.java |  20 +-
 .../ratis/grpc/util/ZeroCopyMessageMarshaller.java |   8 +-
 .../apache/ratis/grpc/MiniRaftClusterWithGrpc.java |  34 +-
 ratis-metrics-api/pom.xml                          |   2 +-
 .../org/apache/ratis/metrics/RatisMetrics.java     |   7 +
 ratis-metrics-default/pom.xml                      |  13 +-
 .../ratis/metrics/impl/MetricRegistriesImpl.java   |   1 +
 .../apache/ratis/metrics/impl/RefCountingMap.java  |  94 ---
 .../ratis/metrics/TestMetricRegistriesLoader.java  |  18 +-
 ratis-metrics-dropwizard3/pom.xml                  |  12 +-
 .../dropwizard3/Dm3MetricRegistriesImpl.java       |   1 +
 .../dropwizard3/TestLoadDm3MetricRegistries.java   |  14 +-
 .../metrics/dropwizard3/TestRefCountingMap.java    | 147 -----
 ratis-netty/pom.xml                                |   8 +-
 .../java/org/apache/ratis/netty/NettyClient.java   |  21 +-
 .../apache/ratis/netty/NettyDataStreamUtils.java   |  16 +-
 .../java/org/apache/ratis/netty/NettyRpcProxy.java |   4 +-
 .../java/org/apache/ratis/netty/NettyUtils.java    |  20 +
 .../ratis/netty/client/NettyClientReplies.java     |  29 +-
 .../ratis/netty/client/NettyClientStreamRpc.java   |  21 +-
 .../org/apache/ratis/netty/server/ChannelMap.java  |  48 ++
 .../ratis/netty/server/DataStreamManagement.java   | 122 ++--
 .../ratis/netty/server/NettyServerStreamRpc.java   |  12 +-
 .../org/apache/ratis/netty/server/StreamMap.java   |  55 ++
 .../ratis/netty/MiniRaftClusterWithNetty.java      |   4 +-
 ratis-proto/pom.xml                                |   2 +-
 ratis-proto/src/main/proto/Raft.proto              |  11 +
 ratis-replicated-map/pom.xml                       |   2 +-
 ratis-resource-bundle/pom.xml                      |   2 +-
 ratis-server-api/pom.xml                           |   9 +-
 .../apache/ratis/server/DataStreamServerRpc.java   |  10 +-
 .../apache/ratis/server/RaftServerConfigKeys.java  |  14 +-
 .../org/apache/ratis/server/RaftServerRpc.java     |   9 +-
 .../{DataStreamServerRpc.java => ServerRpc.java}   |  14 +-
 .../apache/ratis/server/leader/LogAppender.java    |   2 +
 .../protocol/RaftServerAsynchronousProtocol.java   |  29 +-
 .../org/apache/ratis/server/raftlog/RaftLog.java   |  40 +-
 .../ratis/server/raftlog/RaftLogSequentialOps.java |  37 +-
 .../apache/ratis/statemachine/StateMachine.java    |  64 +-
 .../ratis/statemachine/TransactionContext.java     |  42 +-
 ratis-server/pom.xml                               |  35 +-
 .../ratis/server/impl/ConfigurationManager.java    |   6 +-
 .../apache/ratis/server/impl/FollowerState.java    |   1 +
 .../apache/ratis/server/impl/LeaderElection.java   |   6 +-
 .../org/apache/ratis/server/impl/LeaderLease.java  |   2 +-
 .../apache/ratis/server/impl/LeaderStateImpl.java  |  36 +-
 .../ratis/server/impl/MessageStreamRequests.java   |  45 +-
 .../apache/ratis/server/impl/PendingRequest.java   |  26 +-
 .../apache/ratis/server/impl/PendingRequests.java  |  44 +-
 .../ratis/server/impl/RaftConfigurationImpl.java   |   3 +-
 .../apache/ratis/server/impl/RaftServerImpl.java   | 726 +++++++++------------
 .../ratis/server/impl/RaftServerJmxAdapter.java    |  97 +++
 .../apache/ratis/server/impl/RaftServerProxy.java  |  28 +-
 .../org/apache/ratis/server/impl/RoleInfo.java     |  60 +-
 .../apache/ratis/server/impl/ServerImplUtils.java  |  55 +-
 .../apache/ratis/server/impl/ServerProtoUtils.java |   4 +
 .../org/apache/ratis/server/impl/ServerState.java  |  33 +-
 .../server/impl/SnapshotInstallationHandler.java   |  41 +-
 .../ratis/server/impl/StateMachineUpdater.java     |  22 +-
 .../ratis/server/impl/TransactionManager.java      |  54 +-
 .../apache/ratis/server/impl/WatchRequests.java    |  24 +-
 .../server/leader/InstallSnapshotRequests.java     | 102 ++-
 .../ratis/server/leader/LogAppenderBase.java       |  65 +-
 .../ratis/server/leader/LogAppenderDefault.java    |  33 +-
 .../server/metrics/LeaderElectionMetrics.java      |   1 +
 .../server/metrics/RaftServerMetricsImpl.java      |  34 +
 .../apache/ratis/server/raftlog/LogProtoUtils.java |  63 +-
 .../apache/ratis/server/raftlog/RaftLogBase.java   | 104 ++-
 .../ratis/server/raftlog/memory/MemoryRaftLog.java |  75 ++-
 .../raftlog/segmented/BufferedWriteChannel.java    |   2 -
 .../ratis/server/raftlog/segmented/LogSegment.java | 169 +++--
 .../server/raftlog/segmented/LogSegmentPath.java   |  23 +-
 .../server/raftlog/segmented/SegmentedRaftLog.java |  89 ++-
 .../raftlog/segmented/SegmentedRaftLogCache.java   |  26 +-
 .../raftlog/segmented/SegmentedRaftLogWorker.java  |  31 +-
 .../server/storage/RaftStorageDirectoryImpl.java   |   1 +
 .../ratis/server/storage/SnapshotManager.java      |   1 +
 .../ratis/server/util/ServerStringUtils.java       |  14 +-
 .../ratis/statemachine/impl/BaseStateMachine.java  |   9 +-
 .../statemachine/impl/TransactionContextImpl.java  |  56 +-
 .../ratis/InstallSnapshotFromLeaderTests.java      | 101 ++-
 .../ratis/InstallSnapshotNotificationTests.java    |  24 +-
 .../java/org/apache/ratis/LogAppenderTests.java    |   1 +
 .../org/apache/ratis/OutputStreamBaseTest.java     |   2 -
 .../org/apache/ratis/RaftAsyncExceptionTests.java  |   2 +-
 .../test/java/org/apache/ratis/RaftAsyncTests.java |   6 +-
 .../test/java/org/apache/ratis/RaftBasicTests.java |  43 +-
 .../org/apache/ratis/RaftExceptionBaseTest.java    |   6 +-
 .../test/java/org/apache/ratis/RaftTestUtil.java   |  83 ++-
 .../org/apache/ratis/ReadOnlyRequestTests.java     |   8 +-
 .../java/org/apache/ratis/RetryCacheTests.java     |  22 +-
 .../java/org/apache/ratis/WatchRequestTests.java   |  55 ++
 .../ratis/server/impl/GroupManagementBaseTest.java |  10 +-
 .../ratis/server/impl/LeaderElectionTests.java     | 172 +++--
 .../apache/ratis/server/impl/MiniRaftCluster.java  |  17 +-
 .../server/impl/RaftReconfigurationBaseTest.java   |  12 +-
 .../ratis/server/impl/RaftServerTestUtil.java      |  13 +
 .../ratis/server/impl/RetryCacheTestUtil.java      |   4 +
 .../server/impl/StateMachineShutdownTests.java     |   2 +-
 .../ratis/server/impl/TestLogAppenderMetrics.java  |  20 +-
 .../ratis/server/impl/TestRetryCacheMetrics.java   |  12 +-
 .../server/metrics/TestLeaderElectionMetrics.java  |  14 +-
 .../ratis/server/simulation/RaftServerReply.java   |   1 -
 .../ratis/server/storage/RaftStorageTestUtils.java |  16 +-
 .../ratis/statemachine/RaftSnapshotBaseTest.java   |   3 +-
 .../impl/SimpleStateMachine4Testing.java           |  26 +-
 ratis-shell/pom.xml                                |   2 +-
 .../ratis/shell/cli/sh/group/GroupInfoCommand.java |   1 +
 .../shell/cli/sh/local/RaftMetaConfCommand.java    |  51 +-
 ratis-test/pom.xml                                 |  19 +-
 .../org/apache/ratis/RaftLogTruncateTests.java     |  95 ++-
 .../ratis/TestRaftServerNoLeaderTimeout.java       |  28 +-
 .../ratis/TestRaftServerSlownessDetection.java     |  35 +-
 .../apache/ratis/client/TestClientProtoUtils.java  |   6 +-
 .../java/org/apache/ratis/conf/TestConfUtils.java  |   2 +-
 .../org/apache/ratis/conf/TestRaftProperties.java  |  45 +-
 .../datastream/DataStreamAsyncClusterTests.java    |  12 +-
 .../ratis/datastream/DataStreamBaseTest.java       |  16 +-
 .../ratis/datastream/DataStreamClusterTests.java   |  14 +-
 .../ratis/datastream/DataStreamTestUtils.java      |  61 +-
 ...usterWithRpcTypeGrpcAndDataStreamTypeNetty.java |   1 -
 .../ratis/datastream/TestDataStreamDisabled.java   |  10 +-
 ...amSslWithRpcTypeGrpcAndDataStreamTypeNetty.java |  10 +-
 ...ettyDataStreamChainTopologyWithGrpcCluster.java |   4 +-
 ...NettyDataStreamStarTopologyWithGrpcCluster.java |   4 +-
 .../datastream/TestNettyDataStreamWithMock.java    |  20 +-
 .../TestNettyDataStreamWithNettyCluster.java       |   5 +-
 .../org/apache/ratis/grpc/TestGrpcFactory.java     |   8 +-
 .../apache/ratis/grpc/TestGrpcMessageMetrics.java  |   6 +-
 .../ratis/grpc/TestLeaderElectionWithGrpc.java     |   4 +-
 .../ratis/grpc/TestLeaderInstallSnapshot.java      |  29 +-
 .../apache/ratis/grpc/TestLogAppenderWithGrpc.java |  35 +-
 .../ratis/grpc/TestRaftOutputStreamWithGrpc.java   |   6 +-
 .../apache/ratis/grpc/TestRaftServerWithGrpc.java  |  94 +--
 .../ratis/grpc/TestRaftSnapshotWithGrpc.java       |   8 +-
 .../org/apache/ratis/grpc/TestRaftWithGrpc.java    |  42 +-
 .../apache/ratis/grpc/TestRetryCacheWithGrpc.java  |  14 +-
 .../ratis/grpc/server/TestGrpcServerMetrics.java   |  26 +-
 .../org/apache/ratis/grpc/util/GrpcTestClient.java |   6 +-
 .../org/apache/ratis/grpc/util/GrpcTestServer.java |  23 +-
 .../ratis/grpc/util/GrpcZeroCopyTestClient.java    |  43 +-
 .../ratis/grpc/util/GrpcZeroCopyTestServer.java    |  14 +-
 .../apache/ratis/grpc/util/TestGrpcZeroCopy.java   |  36 +-
 .../grpc/util/TestStreamObserverWithTimeout.java   |  33 +-
 .../ratis/netty/TestLeaderElectionWithNetty.java   |   4 +-
 .../org/apache/ratis/netty/TestRaftWithNetty.java  |   2 +-
 .../apache/ratis/netty/TestTlsConfWithNetty.java   |   8 +-
 .../org/apache/ratis/protocol/TestRaftGroup.java   |  16 +-
 .../java/org/apache/ratis/protocol/TestRaftId.java |  28 +-
 .../apache/ratis/protocol/TestRoutingTable.java    |  14 +-
 .../ratis/retry/TestExceptionDependentRetry.java   |  33 +-
 .../ratis/retry/TestExponentialBackoffRetry.java   |  14 +-
 .../ratis/retry/TestMultipleLinearRandomRetry.java |  18 +-
 .../org/apache/ratis/retry/TestRetryPolicy.java    |  40 +-
 .../apache/ratis/security/SecurityTestUtils.java   |  12 +-
 .../org/apache/ratis/server/ServerBuilderTest.java |   8 +-
 .../apache/ratis/server/ServerRestartTests.java    |  48 +-
 .../ratis/server/TestRaftServerConfigKeys.java     |  24 +-
 .../ratis/server/impl/TestPeerConfiguration.java   |   6 +-
 .../ratis/server/impl/TestRaftConfiguration.java   |  28 +-
 .../ratis/server/impl/TestRaftServerJmx.java       |  27 +-
 .../ratis/server/raftlog/TestRaftLogIndex.java     |  12 +-
 .../ratis/server/raftlog/TestRaftLogMetrics.java   |  44 +-
 .../server/raftlog/memory/MemoryRaftLogTest.java   |  13 +-
 .../segmented/TestBufferedWriteChannel.java        |  15 +-
 .../raftlog/segmented/TestCacheEviction.java       |  91 +--
 .../server/raftlog/segmented/TestLogSegment.java   | 106 +--
 .../raftlog/segmented/TestRaftLogReadWrite.java    |  36 +-
 .../raftlog/segmented/TestSegmentedRaftLog.java    | 209 +++---
 .../segmented/TestSegmentedRaftLogCache.java       | 124 ++--
 .../ratis/server/storage/TestRaftStorage.java      | 150 +++--
 .../ratis/server/storage/TestStorageImplUtils.java |  34 +-
 .../cli/sh/ElectionCommandIntegrationTest.java     |  44 +-
 .../shell/cli/sh/GroupCommandIntegrationTest.java  |  61 +-
 .../shell/cli/sh/LocalCommandIntegrationTest.java  | 147 +++++
 .../shell/cli/sh/PeerCommandIntegrationTest.java   |  16 +-
 .../cli/sh/SnapshotCommandIntegrationTest.java     |  18 +-
 .../apache/ratis/shell/cli/sh/TestRatisShell.java  |  12 +-
 .../ratis/statemachine/TestStateMachine.java       |  16 +-
 .../apache/ratis/util/TestDataBlockingQueue.java   |  33 +-
 .../java/org/apache/ratis/util/TestDataQueue.java  |  73 ++-
 .../java/org/apache/ratis/util/TestExitUtils.java  |  31 +-
 .../java/org/apache/ratis/util/TestLifeCycle.java  |  19 +-
 .../java/org/apache/ratis/util/TestMinMax.java     |  16 +-
 .../org/apache/ratis/util/TestPeerProxyMap.java    |  15 +-
 .../org/apache/ratis/util/TestPreconditions.java   |   9 +-
 .../ratis/util/TestReferenceCountedObject.java     |  45 +-
 .../apache/ratis/util/TestResourceSemaphore.java   |  14 +-
 .../org/apache/ratis/util/TestTimeDuration.java    |  60 +-
 .../apache/ratis/util/TestTimeoutScheduler.java    | 134 ++--
 .../ratis/util/TestTraditionalBinaryPrefix.java    |  20 +-
 ratis-tools/pom.xml                                |   2 +-
 .../java/org/apache/ratis/tools/ParseRatisLog.java |   7 +-
 263 files changed, 5632 insertions(+), 3252 deletions(-)
 create mode 100755 dev-support/checks/coverage.sh
 rename {ratis-netty/src/main/java/org/apache/ratis/netty/server => ratis-common/src/main/java/org/apache/ratis/datastream/impl}/DataStreamRequestByteBuf.java (96%)
 create mode 100644 ratis-common/src/main/java/org/apache/ratis/util/LeakDetector.java
 rename {ratis-metrics-dropwizard3/src/main/java/org/apache/ratis/metrics/dropwizard3 => ratis-common/src/main/java/org/apache/ratis/util}/RefCountingMap.java (88%)
 create mode 100644 ratis-common/src/main/java/org/apache/ratis/util/ReferenceCountedLeakDetector.java
 rename {ratis-metrics-default/src/test/java/org/apache/ratis/metrics/impl => ratis-common/src/test/java/org/apache/ratis/util}/TestRefCountingMap.java (86%)
 create mode 100644 ratis-grpc/src/main/java/org/apache/ratis/grpc/metrics/ZeroCopyMetrics.java
 delete mode 100644 ratis-grpc/src/main/java/org/apache/ratis/grpc/metrics/intercept/server/MetricServerCallListener.java
 delete mode 100644 ratis-metrics-default/src/main/java/org/apache/ratis/metrics/impl/RefCountingMap.java
 delete mode 100644 ratis-metrics-dropwizard3/src/test/java/org/apache/ratis/metrics/dropwizard3/TestRefCountingMap.java
 create mode 100644 ratis-netty/src/main/java/org/apache/ratis/netty/server/ChannelMap.java
 create mode 100644 ratis-netty/src/main/java/org/apache/ratis/netty/server/StreamMap.java
 copy ratis-server-api/src/main/java/org/apache/ratis/server/{DataStreamServerRpc.java => ServerRpc.java} (79%)
 create mode 100644 ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerJmxAdapter.java
 create mode 100644 ratis-test/src/test/java/org/apache/ratis/shell/cli/sh/LocalCommandIntegrationTest.java


(ratis) 02/02: latest snapshot version

Posted by wi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

williamsong pushed a commit to branch snapshot-3
in repository https://gitbox.apache.org/repos/asf/ratis.git

commit 21f25926e74bf47b7fb92f5f4db441931cb2faa3
Author: szywilliam <sz...@163.com>
AuthorDate: Thu May 16 10:59:17 2024 +0800

    latest snapshot version
---
 pom.xml                           | 4 ++--
 ratis-assembly/pom.xml            | 2 +-
 ratis-client/pom.xml              | 2 +-
 ratis-common/pom.xml              | 2 +-
 ratis-docs/pom.xml                | 2 +-
 ratis-examples/pom.xml            | 2 +-
 ratis-experiments/pom.xml         | 2 +-
 ratis-grpc/pom.xml                | 2 +-
 ratis-metrics-api/pom.xml         | 2 +-
 ratis-metrics-default/pom.xml     | 2 +-
 ratis-metrics-dropwizard3/pom.xml | 2 +-
 ratis-netty/pom.xml               | 2 +-
 ratis-proto/pom.xml               | 2 +-
 ratis-replicated-map/pom.xml      | 2 +-
 ratis-resource-bundle/pom.xml     | 2 +-
 ratis-server-api/pom.xml          | 2 +-
 ratis-server/pom.xml              | 2 +-
 ratis-shell/pom.xml               | 2 +-
 ratis-test/pom.xml                | 2 +-
 ratis-tools/pom.xml               | 2 +-
 20 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/pom.xml b/pom.xml
index f8249e0ac..a0638806d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,7 +24,7 @@
 
   <artifactId>ratis</artifactId>
   <groupId>org.apache.ratis</groupId>
-  <version>3.1.0-SNAPSHOT</version>
+  <version>3.1.0-2fddd52-SNAPSHOT</version>
   <name>Apache Ratis</name>
   <packaging>pom</packaging>
   <description>
@@ -162,7 +162,7 @@
 
 
   <properties>
-    <project.build.outputTimestamp>2023-11-19T14:23:30Z</project.build.outputTimestamp>
+    <project.build.outputTimestamp>2024-05-16T02:53:16Z</project.build.outputTimestamp>
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
      <!-- where to find the generated LICENSE files -->
diff --git a/ratis-assembly/pom.xml b/ratis-assembly/pom.xml
index 98826e142..6f85b9403 100644
--- a/ratis-assembly/pom.xml
+++ b/ratis-assembly/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-assembly</artifactId>
diff --git a/ratis-client/pom.xml b/ratis-client/pom.xml
index d1b08d5a6..c5aebec83 100644
--- a/ratis-client/pom.xml
+++ b/ratis-client/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-client</artifactId>
diff --git a/ratis-common/pom.xml b/ratis-common/pom.xml
index 9205e81c2..36a8d69ff 100644
--- a/ratis-common/pom.xml
+++ b/ratis-common/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-common</artifactId>
diff --git a/ratis-docs/pom.xml b/ratis-docs/pom.xml
index 47f1175a4..aebc4aabc 100644
--- a/ratis-docs/pom.xml
+++ b/ratis-docs/pom.xml
@@ -20,7 +20,7 @@ https://maven.apache.org/xsd/maven-4.0.0.xsd">
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-docs</artifactId>
diff --git a/ratis-examples/pom.xml b/ratis-examples/pom.xml
index 7454e928e..28645096f 100644
--- a/ratis-examples/pom.xml
+++ b/ratis-examples/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-examples</artifactId>
diff --git a/ratis-experiments/pom.xml b/ratis-experiments/pom.xml
index 2099142ea..13ff3958e 100644
--- a/ratis-experiments/pom.xml
+++ b/ratis-experiments/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-experiments</artifactId>
diff --git a/ratis-grpc/pom.xml b/ratis-grpc/pom.xml
index 71377b5ef..32ba91851 100644
--- a/ratis-grpc/pom.xml
+++ b/ratis-grpc/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-grpc</artifactId>
diff --git a/ratis-metrics-api/pom.xml b/ratis-metrics-api/pom.xml
index e51a9f963..eb8683e4c 100644
--- a/ratis-metrics-api/pom.xml
+++ b/ratis-metrics-api/pom.xml
@@ -18,7 +18,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-metrics-api</artifactId>
diff --git a/ratis-metrics-default/pom.xml b/ratis-metrics-default/pom.xml
index 4fe807392..cb8dae2f1 100644
--- a/ratis-metrics-default/pom.xml
+++ b/ratis-metrics-default/pom.xml
@@ -18,7 +18,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-metrics-default</artifactId>
diff --git a/ratis-metrics-dropwizard3/pom.xml b/ratis-metrics-dropwizard3/pom.xml
index 42fff0445..f3ce41ae6 100644
--- a/ratis-metrics-dropwizard3/pom.xml
+++ b/ratis-metrics-dropwizard3/pom.xml
@@ -18,7 +18,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-metrics-dropwizard3</artifactId>
diff --git a/ratis-netty/pom.xml b/ratis-netty/pom.xml
index 1966db8ac..34db39348 100644
--- a/ratis-netty/pom.xml
+++ b/ratis-netty/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-netty</artifactId>
diff --git a/ratis-proto/pom.xml b/ratis-proto/pom.xml
index e0cf2c858..631df5e26 100644
--- a/ratis-proto/pom.xml
+++ b/ratis-proto/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-proto</artifactId>
diff --git a/ratis-replicated-map/pom.xml b/ratis-replicated-map/pom.xml
index 5b4b8f21c..28ed91607 100644
--- a/ratis-replicated-map/pom.xml
+++ b/ratis-replicated-map/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-replicated-map</artifactId>
diff --git a/ratis-resource-bundle/pom.xml b/ratis-resource-bundle/pom.xml
index a879a7423..80f9fe3ba 100644
--- a/ratis-resource-bundle/pom.xml
+++ b/ratis-resource-bundle/pom.xml
@@ -23,7 +23,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
     <relativePath>..</relativePath>
   </parent>
 
diff --git a/ratis-server-api/pom.xml b/ratis-server-api/pom.xml
index f3c4b617a..a5d73d6f7 100644
--- a/ratis-server-api/pom.xml
+++ b/ratis-server-api/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-server-api</artifactId>
diff --git a/ratis-server/pom.xml b/ratis-server/pom.xml
index 38af72d9d..1d5afe911 100644
--- a/ratis-server/pom.xml
+++ b/ratis-server/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-server</artifactId>
diff --git a/ratis-shell/pom.xml b/ratis-shell/pom.xml
index 78ab6679f..399e342ce 100644
--- a/ratis-shell/pom.xml
+++ b/ratis-shell/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-shell</artifactId>
diff --git a/ratis-test/pom.xml b/ratis-test/pom.xml
index 01d54ba15..b8fab4c3d 100644
--- a/ratis-test/pom.xml
+++ b/ratis-test/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-test</artifactId>
diff --git a/ratis-tools/pom.xml b/ratis-tools/pom.xml
index c1971ced9..fc99efcec 100644
--- a/ratis-tools/pom.xml
+++ b/ratis-tools/pom.xml
@@ -17,7 +17,7 @@
   <parent>
     <artifactId>ratis</artifactId>
     <groupId>org.apache.ratis</groupId>
-    <version>3.1.0-SNAPSHOT</version>
+    <version>3.1.0-2fddd52-SNAPSHOT</version>
   </parent>
 
   <artifactId>ratis-tools</artifactId>


(ratis) 01/02: reply ALREADY_INSTALLED

Posted by wi...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

williamsong pushed a commit to branch snapshot-3
in repository https://gitbox.apache.org/repos/asf/ratis.git

commit 2fddd52ae25e5f1c263e73f3c2d1c63e918a69d8
Author: szywilliam <sz...@163.com>
AuthorDate: Thu May 16 10:25:32 2024 +0800

    reply ALREADY_INSTALLED
---
 .../ratis/server/impl/ConfigurationManager.java    |  4 +-
 .../org/apache/ratis/server/impl/ServerState.java  |  4 +-
 .../server/impl/SnapshotInstallationHandler.java   |  7 ++-
 .../ratis/InstallSnapshotFromLeaderTests.java      | 70 ++++++++++++++++++++++
 .../test/java/org/apache/ratis/RaftTestUtil.java   | 14 +++++
 .../ratis/server/impl/LeaderElectionTests.java     | 38 ++++--------
 .../ratis/grpc/TestLeaderInstallSnapshot.java      |  6 ++
 7 files changed, 111 insertions(+), 32 deletions(-)

diff --git a/ratis-server/src/main/java/org/apache/ratis/server/impl/ConfigurationManager.java b/ratis-server/src/main/java/org/apache/ratis/server/impl/ConfigurationManager.java
index 10c59c8b1..714177a3e 100644
--- a/ratis-server/src/main/java/org/apache/ratis/server/impl/ConfigurationManager.java
+++ b/ratis-server/src/main/java/org/apache/ratis/server/impl/ConfigurationManager.java
@@ -61,10 +61,10 @@ public class ConfigurationManager {
     }
   }
 
-  synchronized void addConfiguration(RaftConfiguration conf) {
+  synchronized void addConfiguration(RaftConfiguration conf, long commitIndex) {
     final long logIndex = conf.getLogEntryIndex();
     final RaftConfiguration found = configurations.get(logIndex);
-    if (found != null) {
+    if (found != null && logIndex <= commitIndex) {
       Preconditions.assertTrue(found.equals(conf));
       return;
     }
diff --git a/ratis-server/src/main/java/org/apache/ratis/server/impl/ServerState.java b/ratis-server/src/main/java/org/apache/ratis/server/impl/ServerState.java
index 0f46c6b52..285dc16d5 100644
--- a/ratis-server/src/main/java/org/apache/ratis/server/impl/ServerState.java
+++ b/ratis-server/src/main/java/org/apache/ratis/server/impl/ServerState.java
@@ -377,7 +377,9 @@ class ServerState {
   }
 
   void setRaftConf(RaftConfiguration conf) {
-    configurationManager.addConfiguration(conf);
+    final long lastCommittedIndex = server.getState().log.isInitialized() ?
+        server.getRaftLog().getLastCommittedIndex() : RaftLog.INVALID_LOG_INDEX;
+    configurationManager.addConfiguration(conf, lastCommittedIndex);
     server.getServerRpc().addRaftPeers(conf.getAllPeers());
     final Collection<RaftPeer> listeners = conf.getAllPeers(RaftPeerRole.LISTENER);
     if (!listeners.isEmpty()) {
diff --git a/ratis-server/src/main/java/org/apache/ratis/server/impl/SnapshotInstallationHandler.java b/ratis-server/src/main/java/org/apache/ratis/server/impl/SnapshotInstallationHandler.java
index f03e2d883..2f3b3ba7a 100644
--- a/ratis-server/src/main/java/org/apache/ratis/server/impl/SnapshotInstallationHandler.java
+++ b/ratis-server/src/main/java/org/apache/ratis/server/impl/SnapshotInstallationHandler.java
@@ -175,9 +175,10 @@ class SnapshotInstallationHandler {
         // Check and append the snapshot chunk. We simply put this in lock
         // considering a follower peer requiring a snapshot installation does not
         // have a lot of requests
-        Preconditions.assertTrue(state.getLog().getLastCommittedIndex() < lastIncludedIndex,
-            "%s log's commit index is %s, last included index in snapshot is %s",
-            getMemberId(), state.getLog().getLastCommittedIndex(), lastIncludedIndex);
+        if (state.getLog().getLastCommittedIndex() >= lastIncludedIndex) {
+          return toInstallSnapshotReplyProto(leaderId, getMemberId(),
+              currentTerm, snapshotChunkRequest.getRequestIndex(), InstallSnapshotResult.ALREADY_INSTALLED);
+        }
 
         //TODO: We should only update State with installed snapshot once the request is done.
         state.installSnapshot(request);
diff --git a/ratis-server/src/test/java/org/apache/ratis/InstallSnapshotFromLeaderTests.java b/ratis-server/src/test/java/org/apache/ratis/InstallSnapshotFromLeaderTests.java
index 9d6a2f183..e699b79e9 100644
--- a/ratis-server/src/test/java/org/apache/ratis/InstallSnapshotFromLeaderTests.java
+++ b/ratis-server/src/test/java/org/apache/ratis/InstallSnapshotFromLeaderTests.java
@@ -21,7 +21,10 @@ import org.apache.ratis.client.RaftClient;
 import org.apache.ratis.conf.RaftProperties;
 import org.apache.ratis.protocol.RaftClientReply;
 import org.apache.ratis.protocol.RaftGroupId;
+import org.apache.ratis.protocol.RaftPeer;
 import org.apache.ratis.protocol.RaftPeerId;
+import org.apache.ratis.protocol.exceptions.RaftRetryFailureException;
+import org.apache.ratis.retry.RetryPolicies;
 import org.apache.ratis.server.RaftServer;
 import org.apache.ratis.server.RaftServerConfigKeys;
 import org.apache.ratis.server.impl.MiniRaftCluster;
@@ -85,6 +88,12 @@ public abstract class InstallSnapshotFromLeaderTests<CLUSTER extends MiniRaftClu
     runWithNewCluster(1, this::testMultiFileInstallSnapshot);
   }
 
+  public void testInstallSnapshotLeaderSwitch() throws Exception {
+    getProperties().setClass(MiniRaftCluster.STATEMACHINE_CLASS_KEY,
+        StateMachineWithSeparatedSnapshotPath.class, StateMachine.class);
+    runWithNewCluster(3, this::testInstallSnapshotDuringLeaderSwitch);
+  }
+
   private void testMultiFileInstallSnapshot(CLUSTER cluster) throws Exception {
     try {
       int i = 0;
@@ -127,6 +136,67 @@ public abstract class InstallSnapshotFromLeaderTests<CLUSTER extends MiniRaftClu
     }
   }
 
+  private void testInstallSnapshotDuringLeaderSwitch(CLUSTER cluster) throws Exception {
+    try {
+      RaftTestUtil.waitForLeader(cluster);
+      final RaftPeerId leaderId = cluster.getLeader().getId();
+
+      // perform operations and force all peers to take snapshot
+      try (final RaftClient client = cluster.createClient(leaderId)) {
+        for (int i = 0; i < SNAPSHOT_TRIGGER_THRESHOLD * 2; i++) {
+          final RaftClientReply
+              reply = client.io().send(new RaftTestUtil.SimpleMessage("m" + i));
+          Assertions.assertTrue(reply.isSuccess());
+        }
+
+        for (final RaftPeer peer: cluster.getPeers()) {
+          final RaftClientReply snapshotReply = client.getSnapshotManagementApi(leaderId).create(3000);
+          Assertions.assertTrue(snapshotReply.isSuccess());
+        }
+      }
+      final SnapshotInfo snapshot = cluster.getLeader().getStateMachine().getLatestSnapshot();
+      Assertions.assertNotNull(snapshot);
+
+      // isolate two followers (majority) in old configuration
+      final List<RaftServer.Division> oldFollowers = cluster.getFollowers();
+      for (RaftServer.Division f: oldFollowers) {
+        RaftTestUtil.isolate(cluster, f.getId());
+      }
+
+      // add two more peers and install snapshot from leaders
+      final MiniRaftCluster.PeerChanges change = cluster.addNewPeers(2, true,
+          true);
+      try (final RaftClient client = cluster.createClient(leaderId, RetryPolicies.noRetry())) {
+        Assertions.assertThrows(RaftRetryFailureException.class,
+                 () -> client.admin().setConfiguration(change.allPeersInNewConf));
+      }
+
+      final SnapshotInfo snapshotInfo = cluster.getDivision(change.newPeers[0].getId())
+           .getStateMachine().getLatestSnapshot();
+      Assertions.assertNotNull(snapshotInfo);
+
+      // recover the old followers and isolate the leader to force leader switch
+      RaftTestUtil.isolate(cluster, leaderId);
+      for (RaftServer.Division f: oldFollowers) {
+        RaftTestUtil.deIsolate(cluster, f.getId());
+      }
+      RaftTestUtil.waitForLeader(cluster);
+
+      try (final RaftClient client = cluster.createClient(cluster.getLeader().getId())) {
+        // successfully setConfiguration during leader switch
+        final RaftClientReply setConf = client.admin().setConfiguration(change.allPeersInNewConf);
+        Assertions.assertTrue(setConf.isSuccess());
+
+        RaftTestUtil.deIsolate(cluster, leaderId);
+        final RaftClientReply
+              reply = client.io().send(new RaftTestUtil.SimpleMessage("final"));
+        Assertions.assertTrue(reply.isSuccess());
+      }
+    } finally {
+      cluster.shutdown();
+    }
+  }
+
   private static class StateMachineWithMultiNestedSnapshotFile extends SimpleStateMachine4Testing {
 
     File snapshotRoot;
diff --git a/ratis-server/src/test/java/org/apache/ratis/RaftTestUtil.java b/ratis-server/src/test/java/org/apache/ratis/RaftTestUtil.java
index 2c1d34e27..fa1226685 100644
--- a/ratis-server/src/test/java/org/apache/ratis/RaftTestUtil.java
+++ b/ratis-server/src/test/java/org/apache/ratis/RaftTestUtil.java
@@ -513,6 +513,20 @@ public interface RaftTestUtil {
     Thread.sleep(3 * maxTimeout.toLong(TimeUnit.MILLISECONDS));
   }
 
+  static void isolate(MiniRaftCluster cluster, RaftPeerId id) {
+    try {
+      BlockRequestHandlingInjection.getInstance().blockReplier(id.toString());
+      cluster.setBlockRequestsFrom(id.toString(), true);
+    } catch (Exception e) {
+      e.printStackTrace();
+    }
+  }
+
+  static void deIsolate(MiniRaftCluster cluster, RaftPeerId id) {
+    BlockRequestHandlingInjection.getInstance().unblockReplier(id.toString());
+    cluster.setBlockRequestsFrom(id.toString(), false);
+  }
+
   static Thread sendMessageInNewThread(MiniRaftCluster cluster, RaftPeerId leaderId, SimpleMessage... messages) {
     Thread t = new Thread(() -> {
       try (final RaftClient client = cluster.createClient(leaderId)) {
diff --git a/ratis-server/src/test/java/org/apache/ratis/server/impl/LeaderElectionTests.java b/ratis-server/src/test/java/org/apache/ratis/server/impl/LeaderElectionTests.java
index fbb909ac9..d7d58eff1 100644
--- a/ratis-server/src/test/java/org/apache/ratis/server/impl/LeaderElectionTests.java
+++ b/ratis-server/src/test/java/org/apache/ratis/server/impl/LeaderElectionTests.java
@@ -122,12 +122,12 @@ public abstract class LeaderElectionTests<CLUSTER extends MiniRaftCluster>
     final TimeDuration maxTimeout = RaftServerConfigKeys.Rpc.timeoutMax(getProperties());
     final RaftServer.Division leader = waitForLeader(cluster);
     try {
-      isolate(cluster, leader.getId());
+      RaftTestUtil.isolate(cluster, leader.getId());
       maxTimeout.sleep();
       maxTimeout.sleep();
       RaftServerTestUtil.assertLostMajorityHeartbeatsRecently(leader);
     } finally {
-      deIsolate(cluster, leader.getId());
+      RaftTestUtil.deIsolate(cluster, leader.getId());
     }
   }
 
@@ -164,12 +164,12 @@ public abstract class LeaderElectionTests<CLUSTER extends MiniRaftCluster>
     final RaftServer.Division listener = cluster.getListeners().get(0);
     final RaftPeerId listenerId = listener.getId();
     try {
-      isolate(cluster, listenerId);
+      RaftTestUtil.isolate(cluster, listenerId);
       maxTimeout.sleep();
       maxTimeout.sleep();
       Assertions.assertEquals(RaftProtos.RaftPeerRole.LISTENER, listener.getInfo().getCurrentRole());
     } finally {
-      deIsolate(cluster, listener.getId());
+      RaftTestUtil.deIsolate(cluster, listener.getId());
     }
   }
 
@@ -247,7 +247,7 @@ public abstract class LeaderElectionTests<CLUSTER extends MiniRaftCluster>
         RaftServer.Division newLeader = followers.get(0);
 
         // isolate new leader, so that transfer leadership will timeout
-        isolate(cluster, newLeader.getId());
+        RaftTestUtil.isolate(cluster, newLeader.getId());
 
         List<RaftPeer> peers = cluster.getPeers();
 
@@ -287,7 +287,7 @@ public abstract class LeaderElectionTests<CLUSTER extends MiniRaftCluster>
         Assertions.assertEquals(leader.getId().toString(), reply.getReplierId());
         Assertions.assertTrue(reply.isSuccess());
 
-        deIsolate(cluster, newLeader.getId());
+        RaftTestUtil.deIsolate(cluster, newLeader.getId());
       }
 
       cluster.shutdown();
@@ -364,32 +364,18 @@ public abstract class LeaderElectionTests<CLUSTER extends MiniRaftCluster>
       try (RaftClient client = cluster.createClient(leader.getId())) {
         client.io().send(new RaftTestUtil.SimpleMessage("message"));
         Thread.sleep(1000);
-        isolate(cluster, leader.getId());
+        RaftTestUtil.isolate(cluster, leader.getId());
         RaftClientReply reply = client.io().send(new RaftTestUtil.SimpleMessage("message"));
         Assertions.assertNotEquals(reply.getReplierId(), leader.getId().toString());
         Assertions.assertTrue(reply.isSuccess());
       } finally {
-        deIsolate(cluster, leader.getId());
+        RaftTestUtil.deIsolate(cluster, leader.getId());
       }
 
       cluster.shutdown();
     }
   }
 
-  private void isolate(MiniRaftCluster cluster, RaftPeerId id) {
-    try {
-      BlockRequestHandlingInjection.getInstance().blockReplier(id.toString());
-      cluster.setBlockRequestsFrom(id.toString(), true);
-    } catch (Exception e) {
-      e.printStackTrace();
-    }
-  }
-
-  private void deIsolate(MiniRaftCluster cluster, RaftPeerId id) {
-    BlockRequestHandlingInjection.getInstance().unblockReplier(id.toString());
-    cluster.setBlockRequestsFrom(id.toString(), false);
-  }
-
   @Test
   public void testAddListener() throws Exception {
     try (final MiniRaftCluster cluster = newCluster(3)) {
@@ -570,7 +556,7 @@ public abstract class LeaderElectionTests<CLUSTER extends MiniRaftCluster>
         assertEquals(followers.size(), 2);
 
         RaftServer.Division follower = followers.get(0);
-        isolate(cluster, follower.getId());
+        RaftTestUtil.isolate(cluster, follower.getId());
         // send message so that the isolated follower's log lag the others
         RaftClientReply reply = client.io().send(new RaftTestUtil.SimpleMessage("message"));
         Assertions.assertTrue(reply.isSuccess());
@@ -578,7 +564,7 @@ public abstract class LeaderElectionTests<CLUSTER extends MiniRaftCluster>
         final long savedTerm = leader.getInfo().getCurrentTerm();
         LOG.info("Wait follower {} timeout and trigger pre-vote", follower.getId());
         Thread.sleep(2000);
-        deIsolate(cluster, follower.getId());
+        RaftTestUtil.deIsolate(cluster, follower.getId());
         Thread.sleep(2000);
         // with pre-vote leader will not step down
         RaftServer.Division newleader = waitForLeader(cluster);
@@ -668,14 +654,14 @@ public abstract class LeaderElectionTests<CLUSTER extends MiniRaftCluster>
       Assertions.assertTrue(leader.getInfo().isLeaderReady());
       RaftServerTestUtil.assertLeaderLease(leader, true);
 
-      isolate(cluster, leader.getId());
+      RaftTestUtil.isolate(cluster, leader.getId());
       Thread.sleep(leaseTimeoutMs);
 
       Assertions.assertTrue(leader.getInfo().isLeader());
       Assertions.assertTrue(leader.getInfo().isLeaderReady());
       RaftServerTestUtil.assertLeaderLease(leader, false);
     } finally {
-      deIsolate(cluster, leader.getId());
+      RaftTestUtil.deIsolate(cluster, leader.getId());
     }
   }
 
diff --git a/ratis-test/src/test/java/org/apache/ratis/grpc/TestLeaderInstallSnapshot.java b/ratis-test/src/test/java/org/apache/ratis/grpc/TestLeaderInstallSnapshot.java
index 22c590c9d..b85cd1353 100644
--- a/ratis-test/src/test/java/org/apache/ratis/grpc/TestLeaderInstallSnapshot.java
+++ b/ratis-test/src/test/java/org/apache/ratis/grpc/TestLeaderInstallSnapshot.java
@@ -46,4 +46,10 @@ implements MiniRaftClusterWithGrpc.FactoryGet {
         super.testSeparateSnapshotInstallPath();
     }
 
+    @ParameterizedTest
+    @MethodSource("data")
+    public void testInstallSnapshotLeaderSwitch(Boolean separateHeartbeat) throws Exception {
+        GrpcConfigKeys.Server.setHeartbeatChannel(getProperties(), separateHeartbeat);
+        super.testInstallSnapshotLeaderSwitch();
+    }
 }