This is an automated email from the ASF dual-hosted git repository.
xingtanzjr pushed a commit to branch ml_optimize_reader
in repository https://gitbox.apache.org/repos/asf/iotdb.git
The following commit(s) were added to refs/heads/ml_optimize_reader by this
push:
new 7bb6971d8b fix a bug in constructing batch
7bb6971d8b is described below
commit 7bb6971d8b0adc574f853dd19b79598f7fe39743
Author: Jinrui.Zhang <[email protected]>
AuthorDate: Wed Sep 14 14:51:33 2022 +0800
fix a bug in constructing batch
---
.../iotdb/consensus/multileader/logdispatcher/LogDispatcher.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git
a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/logdispatcher/LogDispatcher.java
b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/logdispatcher/LogDispatcher.java
index 014528ec8f..82d0cd98f1 100644
---
a/consensus/src/main/java/org/apache/iotdb/consensus/multileader/logdispatcher/LogDispatcher.java
+++
b/consensus/src/main/java/org/apache/iotdb/consensus/multileader/logdispatcher/LogDispatcher.java
@@ -385,7 +385,9 @@ public class LogDispatcher {
new TLogBatch(innerRequest.serializeToByteBuffer(),
data.getSearchIndex(), true));
}
}
- return logBatches.size() > 0 ? logBatches.get(0).searchIndex :
currentIndex;
+ return logBatches.size() > 0
+ ? logBatches.get(logBatches.size() - 1).searchIndex
+ : currentIndex;
}
private void constructBatchIndexedFromConsensusRequest(