s1monw commented on issue #616: LUCENE-8734: Record nextWriteGens in 
SegmentCommitInfo
URL: https://github.com/apache/lucene-solr/pull/616#issuecomment-475606871
 
 
   > Do we actually need to record these generations, ....
   
   That was my first reaction too. Yet, it's not enough in the scenario that 
the test case shows which I think is realistic in order to roll back to an 
existing commit point. Let me give you an example:
   
   ```
   iw = new IW(keepAllCommits)
   iw.addDocument(<Id:1>)
   iw. softUpdateDocument(<Id:1>) -> writes _0.dvd
   iw.commit() <commit1, dvGen: -1 // no updates>
   iw. softUpdateDocument(<Id:1>)  -> writes _0_1.dvd
   iw.commit() <commit2, dvGen: 1>
   iw.close();
   iw = new IW(<commit1: dvGen -1>) --> IFD updates SegmentCommitInfo to 
<dvGen: -1, nextDvWriteGen: 2> and deletes <commit2, dvGen:1>
   iw.close(); // now only one commit is available 
   
   iw = new IW(<commit1: dvGen -1>) --> IFD updates SegmentCommitInfo to 
<dvGen: -1, nextDvWriteGen: 1> 
   iw. softUpdateDocument(<Id:1>)  -> writes _0_1.dvd and crashes since the 
file already exists.
   
   ```
   
   I hope this makes sense?
   
   
   
   
   
   
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to