Vanlightly commented on a change in pull request #2936:
URL: https://github.com/apache/bookkeeper/pull/2936#discussion_r772967679
##########
File path:
bookkeeper-server/src/main/java/org/apache/bookkeeper/server/Main.java
##########
@@ -340,14 +359,61 @@ public static LifecycleComponentStack
buildBookieServer(BookieConfiguration conf
LedgerDirsManager indexDirsManager =
BookieResources.createIndexDirsManager(
conf.getServerConf(), diskChecker,
bookieStats.scope(LD_INDEX_SCOPE), ledgerDirsManager);
- CookieValidation cookieValidation = new
LegacyCookieValidation(conf.getServerConf(), rm);
-
cookieValidation.checkCookies(storageDirectoriesFromConf(conf.getServerConf()));
-
ByteBufAllocatorWithOomHandler allocator =
BookieResources.createAllocator(conf.getServerConf());
+ UncleanShutdownDetection uncleanShutdownDetection = new
UncleanShutdownDetectionImpl(ledgerDirsManager);
+ if (uncleanShutdownDetection.lastShutdownWasUnclean()) {
+ log.info("Unclean shutdown detected. The bookie did not register a
graceful shutdown prior to this boot.");
+ }
+
// bookie takes ownership of storage, so shuts it down
- LedgerStorage storage = BookieResources.createLedgerStorage(
- conf.getServerConf(), ledgerManager, ledgerDirsManager,
indexDirsManager, bookieStats, allocator);
+ LedgerStorage storage = null;
+ DataIntegrityCheck integCheck = null;
+
+ if (conf.getServerConf().isDataIntegrityCheckingEnabled()) {
+ StatsLogger clientStats = bookieStats.scope(CLIENT_SCOPE);
+ ClientConfiguration clientConfiguration = new
ClientConfiguration(conf.getServerConf());
+
clientConfiguration.setClientRole(ClientConfiguration.CLIENT_ROLE_SYSTEM);
+ BookKeeper bkc =
BookKeeper.forConfig(clientConfiguration).statsLogger(clientStats).build();
+ serverBuilder.addComponent(new
AutoCloseableLifecycleComponent("bkc", bkc));
+
+ BookieId bookieId = BookieImpl.getBookieId(conf.getServerConf());
+ ExecutorService rxExecutor = Executors.newFixedThreadPool(
Review comment:
I have modified the RxSchedulerLifecycleComponent to take ownership of
the rxExecutor and its shutdown.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]