Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CreateFlushConsumeQueueService for loadAndStartConsumerServiceOnly #9032

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ public synchronized boolean start() {
public synchronized boolean shutdown() {
try {
if (!this.loaded) {
LOGGER.info("shutdown OK. {} is not loaded", this.dbPath);
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public class DefaultMessageStore implements MessageStore {

protected final ConsumeQueueStoreInterface consumeQueueStore;

private final FlushConsumeQueueService flushConsumeQueueService;
protected final FlushConsumeQueueService flushConsumeQueueService;

protected final CleanCommitLogService cleanCommitLogService;

Expand Down Expand Up @@ -517,11 +517,9 @@ public void shutdown() {
if (this.compactionService != null) {
this.compactionService.shutdown();
}

if (messageStoreConfig.isRocksdbCQDoubleWriteEnable()) {
if (messageStoreConfig.isRocksdbCQDoubleWriteEnable() && this.rocksDBMessageStore != null) {
this.rocksDBMessageStore.consumeQueueStore.shutdown();
}

this.flushConsumeQueueService.shutdown();
this.allocateMappedFileService.shutdown();
this.storeCheckpoint.flush();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,6 @@ public CleanConsumeQueueService createCleanConsumeQueueService() {
return new RocksDBCleanConsumeQueueService();
}

@Override
public FlushConsumeQueueService createFlushConsumeQueueService() {
return new RocksDBFlushConsumeQueueService();
}

@Override
public CorrectLogicOffsetService createCorrectLogicOffsetService() {
return new RocksDBCorrectLogicOffsetService();
Expand Down Expand Up @@ -198,6 +193,7 @@ public void loadAndStartConsumerServiceOnly() {
throw new RuntimeException("load consume queue failed");
}
super.loadCheckPoint();
this.flushConsumeQueueService.start();
this.consumeQueueStore.start();
} catch (Exception e) {
ERROR_LOG.error("loadAndStartConsumerServiceOnly error", e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ private void loadMaxConsumeQueueOffsets() {
Function<OffsetEntry, Boolean> predicate = entry -> entry.type == OffsetEntryType.MAXIMUM;
Consumer<OffsetEntry> fn = entry -> {
topicQueueMaxCqOffset.putIfAbsent(entry.topic + "-" + entry.queueId, entry.offset);
ROCKSDB_LOG.info("Max {}:{} --> {}|{}", entry.topic, entry.queueId, entry.offset, entry.commitLogOffset);
log.info("LoadMaxConsumeQueueOffsets Max {}:{} --> {}|{}", entry.topic, entry.queueId, entry.offset, entry.commitLogOffset);
};
try {
forEach(predicate, fn);
Expand Down
Loading