rpuch commented on code in PR #2228:
URL: https://github.com/apache/ignite-3/pull/2228#discussion_r1238408528
##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/CatalogServiceImpl.java:
##########
@@ -773,11 +783,21 @@ private void registerCatalog(Catalog newCatalog) {
catalogByTs.put(newCatalog.time(), newCatalog);
}
- private CompletableFuture<Void> saveUpdate(UpdateProducer updateProducer) {
- return saveUpdate(updateProducer, 0);
+ private CompletableFuture<Void>
saveUpdateAndWaitForActivation(UpdateProducer updateProducer) {
+ return saveUpdate(updateProducer, 0)
+ .thenCompose(newVersion -> versionTracker.waitFor(newVersion)
Review Comment:
We have to wait for versionTracker because this is how we make sure that the
version we just created is available in the CatalogServiceImpl internal
mappings; and we need this to obtain the new version activation moment. Only
when we know the activation moment can we compute the target moment we need to
wait for.
The necessity to wait for `versionTracker` to get activation moment will
become obsolete when https://issues.apache.org/jira/browse/IGNITE-19796 gets
implemented.
Thanks, I applied your suggestion with a minor modification.
--
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]