You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by GitBox <gi...@apache.org> on 2019/03/22 12:42:09 UTC

[GitHub] [lucene-solr] s1monw commented on issue #616: LUCENE-8734: Record nextWriteGens in SegmentCommitInfo

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:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org