Skip to content

Commit 52c8107

Browse files
authored
Fix bug in statemachine mode (#139)
1 parent 103cf0a commit 52c8107

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/main/java/io/openmessaging/storage/dledger/DLedgerEntryPusher.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ public DLedgerEntryPusher(DLedgerConfig dLedgerConfig, MemberState memberState,
8282
}
8383
this.entryHandler = new EntryHandler(logger);
8484
this.quorumAckChecker = new QuorumAckChecker(logger);
85+
this.fsmCaller = Optional.empty();
8586
}
8687

8788
public void startup() {
@@ -372,7 +373,7 @@ public void doWork() {
372373
}
373374

374375
if (ackNum == 0) {
375-
checkResponseFuturesTimeout(quorumIndex);
376+
checkResponseFuturesTimeout(quorumIndex + 1);
376377
waitForRunning(1);
377378
}
378379

src/main/java/io/openmessaging/storage/dledger/DLedgerServer.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ public DLedgerServer(DLedgerConfig dLedgerConfig) {
8888
t.setName("DLedgerServer-ScheduledExecutor");
8989
return t;
9090
});
91+
this.fsmCaller = Optional.empty();
9192
}
9293

9394
public void startup() {

src/main/java/io/openmessaging/storage/dledger/statemachine/StateMachineCaller.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ private void doCommitted(final long committedIndex) {
159159
// Check response timeout.
160160
if (iter.getCompleteAckNums() == 0) {
161161
if (this.entryPusher != null) {
162-
this.entryPusher.checkResponseFuturesTimeout(this.lastAppliedIndex.get());
162+
this.entryPusher.checkResponseFuturesTimeout(this.lastAppliedIndex.get() + 1);
163163
}
164164
}
165165
}

0 commit comments

Comments
 (0)