stillalex commented on PR #1504:
URL: https://github.com/apache/solr/pull/1504#issuecomment-1500709938

   I have spent some more time unpacking this test.
   
   Test setup is: shard `shard1` is split into 2 new slices `shard1_0` and 
`shard1_1`, concurrently there are additions happening.
   
   The failure scenario context is:
    - the test client makes direct 'addDoc' calls to the new slice `shard1_1` 
that is in the process of being created. this means the `DistribPhase` is `NONE`
    - target slice (coll.getRouter().getTargetSlice) for the request is `shard1`
    - `isLeader` is `false` on the new slice `shard1_1`. the old shard is still 
considered the leader replica at this point.
    - the new slice has `RECOVERY` state. also because target slice is `shard1` 
the failing doc must be inside the correct slice interval (`isTargetSlice` 
needs to be true). this makes the `isSubShardLeader` `true`
   
   Because the `isLeader` flag is `false`, the `DistributedUpdateProcessor` 
uses whatever version it can extract from the request. Now _if_ this was a 
leader originated request (`phase=FROMLEADER`) there would have been a version 
available, but it is not, so version is `0`. 
   
   there is no integrity check in place to verify the version is > 0 (I added 
one with this PR). but we can do better, we can avoid failing the integrity 
check if we know the `isSubShardLeader` flag is `true` so we can apply a 
'leader logic' strategy and generate a new version before saving the new 
document to the index.


-- 
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

Reply via email to