dsmiley commented on PR #5391:
URL: https://github.com/apache/solr/pull/5391#issuecomment-7229108652

   @shihchengwei-lab re: [versioned DBQ 
replay](https://github.com/apache/solr/pull/5391#issuecomment-7217646168)
   
   Thanks for the careful repro. The replay result is real: a newer child under 
an older DBQ-matched root gets deleted. But I don't think a real update stream 
can produce that sequence.
   
   A DBQ only runs with an older `_version_` on the non-leader path, meaning a 
replica handling a `FROM_LEADER` update or a tlog replay/peer sync. On a 
leader, or in standalone mode, the DBQ always gets a fresh version, and a 
client-supplied `_version_` is ignored. So the version order is the leader's 
order. In your repro the DBQ has version 2 and the child update a much higher 
version, which means the leader applied the DBQ first. With this PR, that DBQ 
already deleted the child as a descendant of the matched root. The in-place 
update that follows can't find its doc and falls back to an atomic update, 
which then fails ("Document not found for update. id=R"). The leader therefore 
never accepts that update, and no replica or tlog can contain it. If the leader 
had applied the in-place update first, the child's version would be older than 
the DBQ's, and deleting it would be correct.
   
   This small test demonstrates both points on a single node: the in-place 
update is rejected after the DBQ, and a client `_version_` on a DBQ is ignored: 
https://gist.github.com/dsmiley/d89c4215e0d87a133fd97684873ffefb
   
   The sequence only arises from hand-built `FROM_LEADER` input, or in theory 
from a leader running pre-PR code during a rolling upgrade. I don't think the 
upgrade case justifies extra complexity here. An in-place update to a child 
does leave the block with mixed versions, which is a quirk worth knowing about, 
but this PR doesn't depend on block versions being uniform.
   
   🤖 This response was AI-generated with Claude Code.
   


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

Reply via email to