Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
76 commits
Select commit Hold shift + click to select a range
84285d3
RATIS-1925. Support Zero-Copy in GrpcClientProtocolService (#1007)
duongkame Jan 13, 2024
59dfd35
RATIS-1998. Add watch request metrics (#1009)
ivandika3 Jan 13, 2024
2062058
RATIS-1989. Intermittent timeout in TestStreamObserverWithTimeout (#1…
adoroszlai Jan 15, 2024
863c2e8
RATIS-1987. Intermittent NPE in TestGrpcZeroCopy. (#1013)
szetszwo Jan 15, 2024
6671ef6
RATIS-1999. Move RaftServerJmxAdapter out from RaftServerImpl. (#1010)
szetszwo Jan 16, 2024
2448256
RATIS-2001. TransactionContext can be wrongly reused. (#1015)
szetszwo Jan 17, 2024
eae0d18
RATIS-2005. Fix URF_UNREAD_FIELD in MetricServerCallListener (#1018)
adoroszlai Jan 18, 2024
859a410
RATIS-2006. Fix DM_EXIT in filestore Client (#1019)
adoroszlai Jan 18, 2024
14eb0bf
RATIS-2002. Fix findbugs warnings in LogSegmentPath (#1017)
adoroszlai Jan 18, 2024
5d4ec69
RATIS-1990. Refactor appendEntries processing to support reference co…
duongkame Jan 18, 2024
82f7b3b
RATIS-2003. Fix IT_NO_SUCH_ELEMENT in InstallSnapshotRequests (#1016)
adoroszlai Jan 18, 2024
fc5c725
RATIS-2004. Fix EQ_COMPARETO_USE_OBJECT_EQUALS in LogSegment (#1020)
adoroszlai Jan 18, 2024
82c31ea
RATIS-2009. ReferenceCount should work for all LogEntry types. (#1021)
duongkame Jan 19, 2024
d459eb6
RATIS-1934. Support Zero-Copy in GrpcServerProtocolService (#1014)
duongkame Jan 19, 2024
561cd6d
RATIS-2010. Remove dependency on spotbugs-annotations (#1022)
adoroszlai Jan 19, 2024
c1e0ec2
RATIS-2013. OrderedAsync retry results an IllegalStateException in Gr…
szetszwo Jan 22, 2024
0e24757
RATIS-1972. Add junit 5 dependencies in ratis-server. (#1003)
nandakumar131 Jan 23, 2024
ea1341b
RATIS-2012. Client should not retry after close. (#1025)
szetszwo Jan 23, 2024
79923c2
RATIS-2008. Follower should recognize candidate if the candidate is t…
ivandika3 Jan 24, 2024
e2aaddc
RATIS-2007. Zero-copy buffers are not released (#1027)
duongkame Jan 25, 2024
a18d08c
RATIS-2015. Node.js 16 actions are deprecated (#1028)
adoroszlai Jan 25, 2024
5560718
RATIS-2011. When a log entry is truncated, remove TransactionContext.…
szetszwo Jan 25, 2024
7d587ec
RATIS-2017: checkAndEvictCache must be done in writeLock. (#1031)
duongkame Jan 27, 2024
035cd96
RATIS-2016. Correct NotificationInstallSnapshot's index (#1030)
symious Jan 28, 2024
9cd74a2
RATIS-1974. Migrate ratis-metrics-default tests to Junit 5 (#1034)
nandakumar131 Jan 29, 2024
c4b10fa
RATIS-2018. Zero-copy buffers are not released - 2nd chunk (#1032)
duongkame Jan 30, 2024
cf897f0
RATIS-1973. Migrate ratis-examples tests to Junit 5. (#1035)
nandakumar131 Jan 30, 2024
d2f1c57
RATIS-2019 Fixed abnormal exit of StateMachineUpdater (#1033)
OneSizeFitsQuorum Jan 30, 2024
c46da22
RATIS-1978. Add tests assertions to verify all zero-copy messages are…
duongkame Jan 31, 2024
a2cb49e
RATIS-1975. Migrate ratis-metrics-dropwizard3 tests to Junit 5. (#1037)
nandakumar131 Feb 1, 2024
e44de26
RATIS-1976. Migrate ratis-test tests to Junit 5 - Part 1 (#1038)
nandakumar131 Feb 1, 2024
4f5612f
RATIS-2023. Remove duplicate RefCountingMap (#1039)
adoroszlai Feb 1, 2024
775b286
RATIS-1997. Refactor StateMachine interface to use ReferenceCountedOb…
duongkame Feb 1, 2024
1d99921
RATIS-2024. Refactor appendEntries code. (#1040)
szetszwo Feb 6, 2024
16b6536
RATIS-2025. Move out assert and proto methods from RaftServerImpl. (#…
szetszwo Feb 7, 2024
67b7650
RATIS-2021. Migrate ratis-test tests to Junit 5 - Part 2. (#1043)
nandakumar131 Feb 20, 2024
044b111
RATIS-2027. Ratis Streaming: Remote Stream copy data to heap. (#1044)
szetszwo Feb 21, 2024
53d35c0
RATIS-2020. Refactor TransactionContext to supply LogEntryProto via a…
duongkame Feb 21, 2024
1bd4510
RATIS-2038. IllegalStateException when ServerState is closed before s…
szetszwo Mar 1, 2024
df436c7
RATIS-2035. Refactor streaming code for Read. (#1046)
szetszwo Mar 7, 2024
99a833c
Ratis-2031. Add peer info to response of GroupInfoCommand CLI (#1047)
DaveTeng0 Mar 8, 2024
e199daa
RATIS-2028. Refactor RaftLog to supply log as ReferenceCountedObject …
duongkame Mar 12, 2024
422cb9d
RATIS-2043. Change toString() of RaftConfigurationImpl (#1051)
symious Mar 15, 2024
44a4f1f
RATIS-2044. Fix ReadIndex loss caused by data race in AppendEntriesLi…
SzyWilliam Mar 18, 2024
72c060d
RATIS-2045. SnapshotInstallationHandler doesn't notify follower when …
hemantk-12 Mar 20, 2024
c3d615b
RATIS-2047. Avoid unnecessary warn log when creating raft group (#1054)
OneSizeFitsQuorum Mar 22, 2024
be497d5
RATIS-2048. Fix SimpleStateMachineStorage potential NPE exception (#1…
OneSizeFitsQuorum Mar 22, 2024
0f631fe
RATIS-2036. Avoid trigger snapshot when removing raftGroup (#1055)
OneSizeFitsQuorum Mar 23, 2024
54c2b1f
RATIS-2049. Suppress Sonar warning for volatile objects (#1057)
OneSizeFitsQuorum Mar 25, 2024
14dbbf3
RATIS-2050. Add creationGap param to snapshot management API (#1058)
SzyWilliam Mar 26, 2024
397c2ef
RATIS-2026. LogAppender to consume log entries with reference count (…
duongkame Mar 27, 2024
a99e709
RATIS-2052. Add docs for triggering snapshot when removing raftGroup …
OneSizeFitsQuorum Mar 29, 2024
c73a3eb
RATIS-1979. Allow StateMachine.read to return a ReferentCountedObject…
duongkame Apr 2, 2024
f404244
RATIS-2051. Fix Sonar bugs for Ratis. (#1059)
OneSizeFitsQuorum Apr 3, 2024
bc6221b
RATIS-1519. When DataStreamManagement#read an exception occurs, remov…
guohao-rosicky Apr 8, 2024
8638a2f
Ratis-2040. Fix RaftPeerId generated by command of "raftMetaConf" to …
DaveTeng0 Apr 10, 2024
49b4006
RATIS-1504. Add timeout handling to DataStreamManagement#checkSuccess…
szetszwo Apr 12, 2024
8913a99
RATIS-2056. Update purge index when snapshot installed. (#1065)
SzyWilliam Apr 12, 2024
cf9d229
RATIS-2057. Add back JavaUtils.attemptUntilTrue(..). (#1066)
szetszwo Apr 16, 2024
ee09075
RATIS-2059. Missing reference count when putting log entries to cache…
duongkame Apr 17, 2024
8704cd2
RATIS-2055. Move notifyTermIndexUpdated after leader.checkReady (#1068)
symious Apr 19, 2024
7f1b1b6
RATIS-2060 Avoid unexpected shutdown of RaftServerProxy during member…
OneSizeFitsQuorum Apr 25, 2024
b0ec114
RATIS-2061. Fix setCloseThreshold parameter in RaftServerConfigKeys (…
whbing Apr 26, 2024
1fe59e0
RATIS-2065. Avoid the out-of-heap memory OOM phenomenon of frequent c…
OneSizeFitsQuorum Apr 29, 2024
4e3eee7
RATIS-2069. RaftMetaConf command sets incorrect peerAddress pattern. …
sadanand48 May 3, 2024
51244e4
RATIS-2068. Avoid logging raw StateMachine data body. (#1074)
duongkame May 3, 2024
cbd9793
RATIS-2070. Skip push build for dependabot (#1077)
adoroszlai May 5, 2024
6fc4222
RATIS-2071. Bump Bouncy Castle to 1.78.1 (#1076)
dependabot[bot] May 5, 2024
5867192
RATIS-2072. Limit timeout of CI workflow jobs (#1078)
adoroszlai May 6, 2024
839f8fb
RATIS-2073. Enable Surefire process checkers (#1079)
adoroszlai May 6, 2024
3888520
RATIS-2067. Enhance content for concept in ratis-docs. (#1073)
OneSizeFitsQuorum May 7, 2024
ac05d64
RATIS-2074. Intermittent fork timeout in TestRaftWithNetty#testBasicA…
szetszwo May 7, 2024
e176501
RATIS-2078. Correct timeout unit for tests (#1083)
symious May 8, 2024
7a06fd8
[RATIS-2082] RaftPeers equal should also check address
AngersZhuuuu May 9, 2024
85a1626
Update LeaderElectionTests.java
AngersZhuuuu May 9, 2024
e2c015b
Update LeaderElectionTests.java
AngersZhuuuu May 9, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
RATIS-2068. Avoid logging raw StateMachine data body. (#1074)
  • Loading branch information
duongkame authored May 3, 2024
commit 51244e42cabb98f7ac9ca144e311222d9c6e5a45
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ boolean isHeartbeat(AppendEntriesRequestProto request) {

@Override
String requestToString(AppendEntriesRequestProto request) {
return ServerStringUtils.toAppendEntriesRequestString(request);
return ServerStringUtils.toAppendEntriesRequestString(request, null);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1471,7 +1471,8 @@ public CompletableFuture<AppendEntriesReplyProto> appendEntriesAsync(

return appendEntriesAsync(leaderId, request.getCallId(), previous, requestRef);
} catch(Exception t) {
LOG.error("{}: Failed appendEntries* {}", getMemberId(), toAppendEntriesRequestString(r), t);
LOG.error("{}: Failed appendEntries* {}", getMemberId(),
toAppendEntriesRequestString(r, stateMachine::toStateMachineLogEntryString), t);
throw IOUtils.asIOException(t);
} finally {
requestRef.release();
Expand Down Expand Up @@ -1530,7 +1531,7 @@ private CompletableFuture<AppendEntriesReplyProto> appendEntriesAsync(RaftPeerId
final List<LogEntryProto> entries = proto.getEntriesList();
final boolean isHeartbeat = entries.isEmpty();
logAppendEntries(isHeartbeat, () -> getMemberId() + ": appendEntries* "
+ toAppendEntriesRequestString(proto));
+ toAppendEntriesRequestString(proto, stateMachine::toStateMachineLogEntryString));

final long leaderTerm = proto.getLeaderTerm();
final long currentTerm;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import org.apache.ratis.proto.RaftProtos.*;
import org.apache.ratis.protocol.ClientId;
import org.apache.ratis.protocol.ClientInvocationId;
import org.apache.ratis.protocol.RaftClientRequest;
import org.apache.ratis.protocol.RaftPeer;
import org.apache.ratis.server.RaftConfiguration;
Expand All @@ -46,9 +45,10 @@ public static String toLogEntryString(LogEntryProto entry, Function<StateMachine
}
final String s;
if (entry.hasStateMachineLogEntry()) {
s = ", " + Optional.ofNullable(function)
.orElseGet(() -> proto -> "" + ClientInvocationId.valueOf(proto))
.apply(entry.getStateMachineLogEntry());
if (function == null) {
function = LogProtoUtils::stateMachineLogEntryProtoToString;
}
s = ", " + function.apply(entry.getStateMachineLogEntry());
} else if (entry.hasMetadataEntry()) {
final MetadataProto metadata = entry.getMetadataEntry();
s = "(c:" + metadata.getCommitIndex() + ")";
Expand All @@ -70,7 +70,11 @@ static String peersToString(List<RaftPeerProto> peers) {
}

static String stateMachineLogEntryProtoToString(StateMachineLogEntryProto p) {
return "logData:" + p.getLogData() + ", stateMachineEntry:" + p.getType() + ":" + p.getStateMachineEntry();
final StateMachineEntryProto stateMachineEntry = p.getStateMachineEntry();
return p.getType()
+ ": logData.size=" + p.getLogData().size()
+ ", stateMachineData.size=" + stateMachineEntry.getStateMachineData().size()
+ ", logEntryProtoSerializedSize=" + stateMachineEntry.getLogEntryProtoSerializedSize();
}

public static String toLogEntryString(LogEntryProto entry) {
Expand All @@ -82,10 +86,11 @@ public static String toLogEntriesString(List<LogEntryProto> entries) {
: entries.stream().map(LogProtoUtils::toLogEntryString).collect(Collectors.toList()).toString();
}

public static String toLogEntriesShortString(List<LogEntryProto> entries) {
public static String toLogEntriesShortString(List<LogEntryProto> entries,
Function<StateMachineLogEntryProto, String> stateMachineToString) {
return entries == null ? null
: entries.isEmpty()? "<empty>"
: "size=" + entries.size() + ", first=" + LogProtoUtils.toLogEntryString(entries.get(0));
: "size=" + entries.size() + ", first=" + toLogEntryString(entries.get(0), stateMachineToString);
}

public static LogEntryProto toLogEntryProto(RaftConfiguration conf, Long term, long index) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,10 @@ private long appendImpl(long term, TransactionContext operation) throws StateMac

appendEntry(operation.wrap(e), operation).whenComplete((returned, t) -> {
if (t != null) {
LOG.error(name + ": Failed to write log entry " + LogProtoUtils.toLogEntryString(e), t);
LOG.error(name + ": Failed to write log entry " + toLogEntryString(e), t);
} else if (returned != nextIndex) {
LOG.error("{}: Indices mismatched: returned index={} but nextIndex={} for log entry {}",
name, returned, nextIndex, LogProtoUtils.toLogEntryString(e));
name, returned, nextIndex, toLogEntryString(e));
} else {
return; // no error
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,7 @@ public ReferenceCountedObject<EntryWithData> retainEntryWithData(long index) thr
}
return future != null? newEntryWithData(entryRef, future): newEntryWithData(entryRef);
} catch (Exception e) {
final String err = getName() + ": Failed readStateMachineData for " +
LogProtoUtils.toLogEntryString(entry);
final String err = getName() + ": Failed readStateMachineData for " + toLogEntryString(entry);
LOG.error(err, e);
throw new RaftLogIOException(err, JavaUtils.unwrapCompletionException(e));
}
Expand Down Expand Up @@ -467,7 +466,7 @@ protected CompletableFuture<Long> appendEntryImpl(ReferenceCountedObject<LogEntr
}
return write.getFuture().whenComplete((clientReply, exception) -> appendEntryTimerContext.stop());
} catch (Exception e) {
LOG.error("{}: Failed to append {}", getName(), LogProtoUtils.toLogEntryString(entry), e);
LOG.error("{}: Failed to append {}", getName(), toLogEntryString(entry), e);
throw e;
} finally {
entryRef.release();
Expand Down Expand Up @@ -578,7 +577,8 @@ SegmentedRaftLogCache getRaftLogCache() {

@Override
public String toLogEntryString(LogEntryProto logEntry) {
return LogProtoUtils.toLogEntryString(logEntry, stateMachine::toStateMachineLogEntryString);
return LogProtoUtils.toLogEntryString(logEntry, stateMachine != null ?
stateMachine::toStateMachineLogEntryString : null);
}

public static Builder newBuilder() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@
import org.apache.ratis.proto.RaftProtos.InstallSnapshotRequestProto;
import org.apache.ratis.proto.RaftProtos.LogEntryProto;
import org.apache.ratis.proto.RaftProtos.RequestVoteReplyProto;
import org.apache.ratis.proto.RaftProtos.StateMachineLogEntryProto;
import org.apache.ratis.server.protocol.TermIndex;
import org.apache.ratis.server.raftlog.LogProtoUtils;
import org.apache.ratis.util.ProtoUtils;

import java.util.List;
import java.util.function.Function;

/**
* This class provides convenient utilities for converting Protocol Buffers messages to strings.
Expand All @@ -41,7 +43,8 @@
public final class ServerStringUtils {
private ServerStringUtils() {}

public static String toAppendEntriesRequestString(AppendEntriesRequestProto request) {
public static String toAppendEntriesRequestString(AppendEntriesRequestProto request,
Function<StateMachineLogEntryProto, String> stateMachineToString) {
if (request == null) {
return null;
}
Expand All @@ -51,7 +54,8 @@ public static String toAppendEntriesRequestString(AppendEntriesRequestProto requ
+ ",previous=" + TermIndex.valueOf(request.getPreviousLog())
+ ",leaderCommit=" + request.getLeaderCommit()
+ ",initializing? " + request.getInitializing()
+ "," + (entries.isEmpty()? "HEARTBEAT" : "entries: " + LogProtoUtils.toLogEntriesShortString(entries));
+ "," + (entries.isEmpty()? "HEARTBEAT" : "entries: " +
LogProtoUtils.toLogEntriesShortString(entries, stateMachineToString));
}

public static String toAppendEntriesReplyString(AppendEntriesReplyProto reply) {
Expand Down