sashapolo commented on code in PR #1023:
URL: https://github.com/apache/ignite-3/pull/1023#discussion_r950278841
##########
modules/configuration/src/main/java/org/apache/ignite/internal/configuration/ConfigurationChanger.java:
##########
@@ -572,20 +572,24 @@ private CompletableFuture<Void> updateFromListener(Data
changedEntries) {
storageRoots = new StorageRoots(newSuperRoot, newChangeId);
- if (dataValuesPrefixMap.isEmpty()) {
- oldStorageRoots.changeFuture.complete(null);
-
- return CompletableFuture.completedFuture(null);
- } else {
- return notificator.notify(oldSuperRoot, newSuperRoot, newChangeId,
notificationListenerCnt.incrementAndGet())
- .whenComplete((v, t) -> {
- if (t == null) {
+ // Save revisions for recovery.
+ return storage.writeConfigurationRevision(oldStorageRoots.version,
storageRoots.version)
+ .thenCompose(unused -> {
+ if (dataValuesPrefixMap.isEmpty()) {
oldStorageRoots.changeFuture.complete(null);
+
+ return CompletableFuture.completedFuture(null);
} else {
- oldStorageRoots.changeFuture.completeExceptionally(t);
+ long notificationNumber =
notificationListenerCnt.incrementAndGet();
+ return notificator.notify(oldSuperRoot, newSuperRoot,
newChangeId, notificationNumber).whenComplete((v, t) -> {
Review Comment:
1. There should be a line break.
2. The same thing: I would suggest to move `whenComplete` to the next line
--
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]