Skip to content

Commit 5b1f784

Browse files
author
shangyu.wh
committed
fix push confirm success
1 parent 79f9167 commit 5b1f784

File tree

2 files changed

+20
-19
lines changed
  • server
    • server/session/src/main/java/com/alipay/sofa/registry/server/session/scheduler/task
    • store/jraft/src/main/java/com/alipay/sofa/registry/jraft/bootstrap

2 files changed

+20
-19
lines changed

server/server/session/src/main/java/com/alipay/sofa/registry/server/session/scheduler/task/PushTaskClosure.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ public void run(ProcessingResult processingResult, Task task) {
6666
if (result == null) {
6767
if (processingResult == ProcessingResult.Success) {
6868
tasks.remove(task.getTaskId());
69+
if (tasks.isEmpty()) {
70+
LOGGER.info("Push all tasks success,dataInfoId={}", dataInfoId);
71+
if (taskClosure != null) {
72+
taskClosure.run(ProcessingResult.Success, null);
73+
}
74+
}
6975
}
7076
}
7177
}
@@ -81,12 +87,7 @@ public void start() {
8187

8288
pushTaskCheckAsyncHashedWheelTimer.newTimeout(timeout -> {
8389

84-
if (tasks.isEmpty()) {
85-
LOGGER.info("Push all tasks success,dataInfoId={}",dataInfoId);
86-
if (taskClosure != null) {
87-
taskClosure.run(ProcessingResult.Success, null);
88-
}
89-
} else {
90+
if (!tasks.isEmpty()) {
9091
LOGGER.warn("Push tasks found error tasks {},dataInfoId={}!", tasks.size(),dataInfoId);
9192
if (taskClosure != null) {
9293
taskClosure.run(ProcessingResult.PermanentError, null);

server/store/jraft/src/main/java/com/alipay/sofa/registry/jraft/bootstrap/RaftServer.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -183,19 +183,19 @@ private NodeOptions initNodeOptions(RaftServerConfig raftServerConfig) {
183183

184184
// See https://github.com/sofastack/sofa-jraft/pull/156
185185
final BlockBasedTableConfig conf = new BlockBasedTableConfig() //
186-
// Begin to use partitioned index filters
187-
// https://github.com/facebook/rocksdb/wiki/Partitioned-Index-Filters#how-to-use-it
188-
.setIndexType(IndexType.kTwoLevelIndexSearch) //
189-
.setFilter(new BloomFilter(16, false)) //
190-
.setPartitionFilters(true) //
191-
.setMetadataBlockSize(8 * SizeUnit.KB) //
192-
.setCacheIndexAndFilterBlocks(false) //
193-
.setCacheIndexAndFilterBlocksWithHighPriority(true) //
194-
.setPinL0FilterAndIndexBlocksInCache(true) //
195-
// End of partitioned index filters settings.
196-
.setBlockSize(4 * SizeUnit.KB)//
197-
.setBlockCacheSize(raftServerConfig.getRockDBCacheSize() * SizeUnit.MB) //
198-
.setCacheNumShardBits(8);
186+
// Begin to use partitioned index filters
187+
// https://github.com/facebook/rocksdb/wiki/Partitioned-Index-Filters#how-to-use-it
188+
.setIndexType(IndexType.kTwoLevelIndexSearch) //
189+
.setFilter(new BloomFilter(16, false)) //
190+
.setPartitionFilters(true) //
191+
.setMetadataBlockSize(8 * SizeUnit.KB) //
192+
.setCacheIndexAndFilterBlocks(false) //
193+
.setCacheIndexAndFilterBlocksWithHighPriority(true) //
194+
.setPinL0FilterAndIndexBlocksInCache(true) //
195+
// End of partitioned index filters settings.
196+
.setBlockSize(4 * SizeUnit.KB)//
197+
.setBlockCacheSize(raftServerConfig.getRockDBCacheSize() * SizeUnit.MB) //
198+
.setCacheNumShardBits(8);
199199

200200
StorageOptionsFactory.registerRocksDBTableFormatConfig(RocksDBLogStorage.class, conf);
201201

0 commit comments

Comments
 (0)