ibessonov commented on code in PR #2844:
URL: https://github.com/apache/ignite-3/pull/2844#discussion_r1394205600
##########
modules/runner/src/main/java/org/apache/ignite/internal/configuration/storage/DistributedConfigurationStorage.java:
##########
@@ -265,22 +257,9 @@ public CompletableFuture<Boolean> write(Map<String, ?
extends Serializable> newV
// - First update ever, MASTER_KEY property must be absent from
MetaStorage.
// - Current node has already performed some updates or received them
from MetaStorage watch listener. In this
// case "curChangeId" must match the MASTER_KEY revision exactly.
- // - Current node has been restarted and received updates from
MetaStorage watch listeners after that. Same as
- // above, "curChangeId" must match the MASTER_KEY revision exactly.
- // - Current node has been restarted and have not received any
updates from MetaStorage watch listeners yet.
- // In this case "curChangeId" matches MetaStorage's local revision,
which may or may not match the MASTER_KEY revision. Two
- // options here:
- // - MASTER_KEY is missing in local MetaStorage copy. This means
that current node have not performed nor
- // observed any configuration changes. Valid condition is
"MASTER_KEY does not exist".
- // - MASTER_KEY is present in local MetaStorage copy. The
MASTER_KEY revision is unknown but is less than or
- // equal to MetaStorage's local revision. Obviously, there have
been no updates from the future yet. It's also guaranteed
- // that the next received configuration update will have the
MASTER_KEY revision strictly greater than
- // current MetaStorage's local revision. This allows to conclude
that "MASTER_KEY revision <= curChangeId" is a valid
- // condition for update.
- // Joining all of the above, it's concluded that the following
condition must be used:
- Condition condition = curChangeId == 0L
+ Condition condition = changeId == 0
Review Comment:
I'd ask to re-formulate the `Current node has already performed some updates
or received them from MetaStorage watch listener`. Simple `Otherwise` would do
it.
Deleted part of the comment makes no sense after the fix, this is fine
--
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]