dsmiley commented on code in PR #1504: URL: https://github.com/apache/solr/pull/1504#discussion_r1162098045
########## solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java: ########## @@ -331,7 +342,7 @@ protected boolean versionAdd(AddUpdateCommand cmd) throws IOException { boolean isReplayOrPeersync = (cmd.getFlags() & (UpdateCommand.REPLAY | UpdateCommand.PEER_SYNC)) != 0; - boolean leaderLogic = isLeader && !isReplayOrPeersync; + boolean leaderLogic = leaderLogicWithVersionIntegrityCheck(isReplayOrPeersync, versionOnUpdate); Review Comment: I don't like this change (thus don't like leaderLogicWithVersionIntegrityCheck). If there is some race condition causing the client to route to us (a new sub-shard) before we know that we are ready to accept it, I'd rather not pretend we are ready in any way. Maybe throw an exception like INVALID_STATE that should cause CloudSolrClient to retry. Our state will update eventually. ########## solr/core/src/java/org/apache/solr/update/processor/DistributedUpdateProcessor.java: ########## @@ -282,6 +280,19 @@ public static int bucketHash(BytesRef idBytes) { return Hash.murmurhash3_x86_32(idBytes.bytes, idBytes.offset, idBytes.length, 0); } + private boolean leaderLogicWithVersionIntegrityCheck( Review Comment: place methods after where they are called, not before. -- 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: issues-unsubscr...@solr.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@solr.apache.org For additional commands, e-mail: issues-h...@solr.apache.org