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 12:16:00 UTC

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

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