bookkeeper icon indicating copy to clipboard operation
bookkeeper copied to clipboard

[improve][server] Support entryLogPerLedger, when dbStorage_directIOEntryLogger=true

Open lordcheng10 opened this issue 3 years ago • 10 comments

Motivation

When dbStorage_directIOEntryLogger=true, support for entryLogPerLedger.

Changes

  1. Add a new DirectEntryLoggerForEntryLogPerLedger class extended from DirectEntryLogger;
  2. In DbLedgerStorage, when building the EntryLogger object, judge whether entryLogPerLedgerEnabled is enabled:
 if (conf.isEntryLogPerLedgerEnabled()) {
                    entrylogger = new DirectEntryLoggerForEntryLogPerLedger(conf, ledgerDir,
                            new EntryLogIdsImpl(ledgerDirsManager, slog),
                            new NativeIOImpl(),
                            allocator, entryLoggerWriteExecutor, entryLoggerFlushExecutor,
                            conf.getEntryLogSizeLimit(),
                            conf.getNettyMaxFrameSizeBytes() - 500,
                            perDirectoryTotalWriteBufferSize,
                            perDirectoryTotalReadBufferSize,
                            readBufferSize,
                            numReadThreads,
                            maxFdCacheTimeSeconds,
                            slog, statsLogger);
                } else {
                    entrylogger = new DirectEntryLogger(ledgerDir, new EntryLogIdsImpl(ledgerDirsManager, slog),
                            new NativeIOImpl(),
                            allocator, entryLoggerWriteExecutor, entryLoggerFlushExecutor,
                            conf.getEntryLogSizeLimit(),
                            conf.getNettyMaxFrameSizeBytes() - 500,
                            perDirectoryTotalWriteBufferSize,
                            perDirectoryTotalReadBufferSize,
                            readBufferSize,
                            numReadThreads,
                            maxFdCacheTimeSeconds,
                            slog, statsLogger);
                }

lordcheng10 avatar Dec 01 '22 08:12 lordcheng10

@eolivelli @hangc0276 @StevenLuMT PTAL,thanks!

lordcheng10 avatar Dec 02 '22 02:12 lordcheng10

Would you please add a test to cover it?

OK, I will fix

lordcheng10 avatar Dec 05 '22 03:12 lordcheng10

rerun failure checks

lordcheng10 avatar Dec 11 '22 12:12 lordcheng10

Would you please add a test to cover it?

Fixed,PTAL,thanks! @hangc0276

lordcheng10 avatar Dec 11 '22 12:12 lordcheng10

Would you please add a test to cover it?

Fixed,PTAL,thanks! @hangc0276

lordcheng10 avatar Dec 13 '22 14:12 lordcheng10

PTAL,thanks! @hangc0276 @eolivelli @StevenLuMT

lordcheng10 avatar Dec 14 '22 03:12 lordcheng10

Ping @hangc0276

lordcheng10 avatar Dec 17 '22 01:12 lordcheng10

ping @hangc0276

lordcheng10 avatar Jan 11 '23 02:01 lordcheng10

ping @hangc0276

@lordcheng10 I'm reviewing this Pr, thanks.

hangc0276 avatar Jan 11 '23 03:01 hangc0276

ping @hangc0276

@lordcheng10 I'm reviewing this Pr, thanks.

OK,thank you !

lordcheng10 avatar Jan 11 '23 03:01 lordcheng10