You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by GitBox <gi...@apache.org> on 2020/08/24 10:07:58 UTC

[GitHub] [lucene-solr] s1monw opened a new pull request #1777: LUCENE-9477: Don't leave potentially broken segments file behind

s1monw opened a new pull request #1777:
URL: https://github.com/apache/lucene-solr/pull/1777


   If we fail to rollback an already renamed pending segments file during
   commit due to a failure in directory syncing we might not fully roll back
   to a proper state if we hit a failure during rollback which leaves the index
   in a broken state. This is a best effort approach to remove the renamed file
   in the case of a failure during sync.


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



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


[GitHub] [lucene-solr] s1monw merged pull request #1777: LUCENE-9477: Don't leave potentially broken segments file behind

Posted by GitBox <gi...@apache.org>.
s1monw merged pull request #1777:
URL: https://github.com/apache/lucene-solr/pull/1777


   


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



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


[GitHub] [lucene-solr] mikemccand commented on a change in pull request #1777: LUCENE-9477: Don't leave potentially broken segments file behind

Posted by GitBox <gi...@apache.org>.
mikemccand commented on a change in pull request #1777:
URL: https://github.com/apache/lucene-solr/pull/1777#discussion_r475556180



##########
File path: lucene/core/src/java/org/apache/lucene/index/SegmentInfos.java
##########
@@ -836,16 +835,24 @@ final String finishCommit(Directory dir) throws IOException {
     if (pendingCommit == false) {
       throw new IllegalStateException("prepareCommit was not called");
     }
-    boolean success = false;
+    boolean successRenameAndSync = false;
     final String dest;
     try {
       final String src = IndexFileNames.fileNameFromGeneration(IndexFileNames.PENDING_SEGMENTS, "", generation);
       dest = IndexFileNames.fileNameFromGeneration(IndexFileNames.SEGMENTS, "", generation);
       dir.rename(src, dest);
-      dir.syncMetaData();
-      success = true;
+      try {
+        dir.syncMetaData();

Review comment:
       Our wild randomized testing infra was throwing an exception, rarely, in `syncMetaData`?




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



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