ekaterinadimitrova2 commented on code in PR #1804:
URL: https://github.com/apache/cassandra/pull/1804#discussion_r958548263
##########
src/java/org/apache/cassandra/schema/MigrationCoordinator.java:
##########
@@ -369,22 +418,31 @@ private synchronized boolean
shouldApplySchemaFor(VersionInfo info)
synchronized Future<Void> reportEndpointVersion(InetAddressAndPort
endpoint, UUID version)
{
+ logger.debug("Reported schema {} at endpoint {}", version, endpoint);
if (ignoredEndpoints.contains(endpoint) ||
IGNORED_VERSIONS.contains(version))
{
endpointVersions.remove(endpoint);
removeEndpointFromVersion(endpoint, null);
+ logger.debug("Discarding endpoint {} or schema {} because either
endpoint or schema version were marked as ignored", endpoint, version);
return FINISHED_FUTURE;
}
UUID current = endpointVersions.put(endpoint, version);
if (current != null && current.equals(version))
+ {
+ logger.trace("Skipping report of schema {} from {} because we
already know that", version, endpoint);
return FINISHED_FUTURE;
+ }
VersionInfo info = versionInfo.computeIfAbsent(version,
VersionInfo::new);
if (Objects.equals(schemaVersion.get(), version))
+ {
info.markReceived();
+ logger.trace("Schema {} from {} has been marked as recevied
because it is equal the local schema", version, endpoint);
+ }
info.endpoints.add(endpoint);
- info.requestQueue.addFirst(endpoint);
+ info.requestQueue.addFirst(endpoint); // TODO not sure if it is
correct - given we've just marked this schema version as received, why do we
add a request to receive it?
Review Comment:
The same logic is in `pullComplete`.
Seems to me we `markReceived` before we deal with `requestQueue` in
`maybePullSchema`, I am still not sure why though.... looking again into that
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]