ratis
ratis copied to clipboard
Testing zero-copy bugs fixes (not for merging)
This fix will be split into multiple JIRAs: RATIS-2164, RATIS-2151, RATIS-2173
The following are the bugs found so far:
-
LeakDetector
: assertedallLeaks
is non-empty but printed "allLeaks.size = 0"- Another bug: Tracks are added to the set before calling
retain
. Without callingretain
at all, it is not a leak.
- Another bug: Tracks are added to the set before calling
-
SimpleTracing
andAdvancedTracing
: the methods should be synchronized.- Minor presentation problem:
AdvancedTracing
should have a single track list instead ofretainsTraces
andreleaseTraces
.
- Minor presentation problem:
-
GrpcClientProtocolService.UnorderedRequestStreamObserver.processClientRequest(..)
should use try-finally. -
GrpcLogAppender.appendLog(..)
callsrelease()
incorrectly for exception. -
LogAppenderDefault.sendAppendEntriesWithRetries(..)
callsrelease()
incorrectly for exception. -
LogSegment
cache can release an entry multiple times. -
LogSegment.loadCache(..)
should callretain()
for cache hit. -
SegmentedRaftLog.retainLog(..)
: between getting the entry and callingretain()
, the entry can be released. The "fail to retain" exception, if there is any, can be ignored since It is the same as a cache miss. See #1153 -
SegmentedRaftLog.retainEntryWithData(..)
should release for exception. - Test bug: the log entries stored in
SimpleStateMachine4Testing
can be released. -
LogSegment
: New entries can be added after EntryCache is closed. -
MemoryRaftLog
has similar problems as inSegmentedRaftLog
. -
SegmentedRaftLogWorker
should clean up unfinished tasks in the queue after stopped running.