bruno-roustant commented on code in PR #3412:
URL: https://github.com/apache/solr/pull/3412#discussion_r2175409752


##########
solr/core/src/test/org/apache/solr/update/UpdateLogTest.java:
##########
@@ -218,6 +223,23 @@ public void testApplyPartialUpdatesWithDelete() throws 
Exception {
     }
   }
 
+  @Test
+  public void testLogCleanupWhenNewTransactionLogConstructionFails() throws 
Exception {
+    // Simulate the appearance of a new log file after UpdateLog.init().
+    Path tlogDir = Path.of(ulog.getTlogDir());
+    long lastLogId = scanLastLogId(tlogDir);
+    String newLogName =
+        String.format(
+            Locale.ROOT, UpdateLog.LOG_FILENAME_PATTERN, UpdateLog.TLOG_NAME, 
lastLogId + 1);
+    Path newLogPath = tlogDir.resolve(newLogName);
+    createLogFile(newLogPath);
+
+    // Add a doc and expect no "New transaction log already exists" error when 
creating the new
+    // transaction log.
+    ulogAdd(

Review Comment:
   Without the fix, this call throws the "New transaction log already exists" 
exception.



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