SammyVimes commented on code in PR #2237:
URL: https://github.com/apache/ignite-3/pull/2237#discussion_r1241943596
##########
modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/impl/MetaStorageManagerImpl.java:
##########
@@ -148,6 +158,60 @@ public MetaStorageManagerImpl(
this.clusterTime = new ClusterTimeImpl(busyLock, clock);
}
+ private CompletableFuture<Long> recover(MetaStorageServiceImpl service) {
+ if (!busyLock.enterBusy()) {
+ return CompletableFuture.failedFuture(new NodeStoppingException());
+ }
+
+ try {
+ CompletableFuture<Long> res = new CompletableFuture<>();
+
+ ExecutorService recoveryExecutor =
Executors.newSingleThreadExecutor(
+ NamedThreadFactory.create(clusterService.nodeName(),
"ms-start", LOG)
+ );
+
+ service.currentRevision().whenCompleteAsync((revision, throwable)
-> {
+ if (throwable != null) {
+ res.completeExceptionally(throwable);
+
+ return;
+ }
+
+ LOG.info("Performing MetaStorage recovery from revision {} to
{}", storage.revision(), revision);
+
+ assert revision != null;
+
+ // Busy wait is ok here, because other threads are not doing
any real work,
+ // and for node to start we must wait until storage is up to
this revision.
+ while (storage.revision() < revision) {
Review Comment:
We only need it here and there is no real benefit. The code will be more
complicated and probably less performant
--
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]