We are no longer monitoring this channel, please join Slack! https://join.slack.com/t/atomixio/shared_invite/enQtNDgzNjA5MjMyMDUxLTVmMThjZDcxZDE3ZmU4ZGYwZTc2MGJiYjVjMjFkOWMyNmVjYTc5YjExYTZiOWFjODlkYmE2MjNjYzZhNjU2MjY
/**
* Raft protocol configuration.
*/
public class MultiRaftProtocolConfig extends PrimitiveProtocolConfig<MultiRaftProtocolConfig> {
private String group;
private Partitioner<String> partitioner = Partitioner.MURMUR3;
private Duration minTimeout = Duration.ofMillis(250);
private Duration maxTimeout = Duration.ofSeconds(30);
private ReadConsistency readConsistency = ReadConsistency.SEQUENTIAL;
private CommunicationStrategy communicationStrategy = CommunicationStrategy.LEADER;
private Recovery recoveryStrategy = Recovery.RECOVER;
private int maxRetries = 0;
private Duration retryDelay = Duration.ofMillis(100);
20:25:22.750 [atomix-bootstrap-heartbeat-receiver] INFO i.a.c.d.BootstrapDiscoveryProvider - Joined
20:25:22.751 [atomix-bootstrap-heartbeat-receiver] INFO i.a.c.i.DefaultClusterMembershipService - node-3 - Member activated: Member{id=node-3, address=10.93.79.103:5000, properties={}}
20:25:22.808 [atomix-bootstrap-heartbeat-receiver] INFO i.a.c.i.DefaultClusterMembershipService - Started
20:25:22.808 [atomix-cluster-0] INFO i.a.c.m.i.DefaultClusterCommunicationService - Started
20:25:22.811 [atomix-cluster-0] INFO i.a.c.m.i.DefaultClusterEventService - Started
20:25:22.822 [atomix-0] INFO i.a.p.p.i.DefaultPartitionGroupMembershipService - Started
20:25:22.844 [atomix-0] INFO i.a.p.p.i.HashBasedPrimaryElectionService - Started
20:25:22.895 [atomix-0] INFO i.a.p.r.p.impl.RaftPartitionServer - Starting server for partition PartitionId{id=1, group=system}
Exception in thread "main" java.util.concurrent.CompletionException: java.lang.IllegalArgumentException: limit cannot be negative
at java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:273)
at java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:991)
at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2124)
at io.atomix.primitive.partition.impl.DefaultPartitionService.lambda$start$2(DefaultPartitionService.java:150)
at java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:981)
at java.util.concurrent.CompletableFuture.thenCompose(CompletableFuture.java:2124)
at io.atomix.primitive.partition.impl.DefaultPartitionService.start(DefaultPartitionService.java:138)
at io.atomix.core.Atomix.lambda$startServices$3(Atomix.java:733)
at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:952)
at java.util.concurrent.CompletableFuture$UniCompose.tryFire(CompletableFuture.java:926)
at java.util.concurrent.CompletableFuture$Completion.run(CompletableFuture.java:442)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException: limit cannot be negative
at io.atomix.storage.buffer.AbstractBuffer.limit(AbstractBuffer.java:256)
at io.atomix.storage.journal.JournalSegmentReader.readNext(JournalSegmentReader.java:152)
at io.atomix.storage.journal.JournalSegmentReader.next(JournalSegmentReader.java:113)
at io.atomix.storage.journal.SegmentedJournalReader.next(SegmentedJournalReader.java:163)
at io.atomix.storage.journal.SegmentedJournalReader.initialize(SegmentedJournalReader.java:44)
at io.atomix.storage.journal.SegmentedJournalReader.<init>(SegmentedJournalReader.java:33)
at io.atomix.storage.journal.SegmentedJournal.openReader(SegmentedJournal.java:591)
at io.atomix.protocols.raft.storage.log.RaftLog.openReader(RaftLog.java:70)
at io.atomix.protocols.raft.cluster.impl.RaftMemberContext.resetState(RaftMemberContext.java:77)
at io.atomix.protocols.raft.cluster.impl.RaftClusterContext.<init>(RaftClusterContext.java:95)
at io.atomix.protocols.raft.impl.RaftContext.<init>(RaftContext.java:166)
at io.atomix.protocols.raft.impl.DefaultRaftServer$Builder.build(DefaultRaftServer.java:246)
at io.atomix.protocols.raft.impl.DefaultRaftServer$Builder.build(DefaultRaftServer.java:222)
if (length == 0) {
should just be if (length <= 0) {
JournalSegmentWriter
seems to handle this correctly but not the reader
buffer.skip(cachedEntry.size() + Bytes.INTEGER + Bytes.INTEGER);
// If the buffer length is zero then return.
if (length <= 0) {
buffer.reset();
nextEntry = null;
return;
}
buffer.reset()
resets it back to the correct position to read the length again
buffer.mark()
is called before the length is read, and BufferUnderflowException
is thrown if the bytes can’t be read, and the buffer is reset to mark()
if the entry is invalid. This code skipping invalid/corrupted entries has been used for a long time, just hasn’t run into a case where the length is invalid. That might be something about the Windows implementation.
IllegalArgumentException
02:04:46.839 [raft-server-consensus-partition-1] WARN i.a.p.raft.roles.CandidateRole - RaftServer{consensus-partition-1}{role=CANDIDATE} - io.netty.channel.AbstractChannel$AnnotatedConnectException: syscall:getsockopt(..) failed: Connection refused: 10.93.85.253/10.93.85.253:5000
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.BootstrapMethodError: call site initialization exception02:06:39.656 [raft-server-consensus-partition-1] WARN i.a.p.raft.roles.CandidateRole - RaftServer{consensus-partition-1}{role=CANDIDATE} - io.netty.channel.AbstractChannel$AnnotatedConnectException: syscall:getsockopt(..) failed: Connection refused: 10.93.85.253/10.93.85.253:5000
at java.lang.invoke.CallSite.makeSite(CallSite.java:341)
at java.lang.invoke.MethodHandleNatives.linkCallSiteImpl(MethodHandleNatives.java:307)
at java.lang.invoke.MethodHandleNatives.linkCallSite(MethodHandleNatives.java:297)
at io.atomix.cluster.AtomixCluster.stopServices(AtomixCluster.java:304)
at io.atomix.core.Atomix.lambda$stopServices$9(Atomix.java:758)
at java.util.concurrent.CompletableFuture.uniCompose(CompletableFuture.java:952)
... 9 more
Caused by: java.lang.OutOfMemoryError: Java heap space
ps -ef |grep AtomixAgent | grep -v grep |awk '{print $2}'| xargs kill -9
Change this condition and test it. if (length <= 0 || length > 1024 * 1024) {
kill -9
and poweroff
and have never seen this, so you’re going to have to test some fixes on your end 🙏
byte[]
somewhere
byte[]
for the memory