aoli-al opened a new issue, #13571:
URL: https://github.com/apache/lucene/issues/13571
### Description
I saw the following assertion failure when running
TestSnapshotDeletionPolicy#testMultiThreadedSnapshotting
```
Caused by: java.lang.AssertionError: seqNo=9 vs maxSeqNo=8
at
org.apache.lucene.index.DocumentsWriterDeleteQueue.getNextSequenceNumber(DocumentsWriterDeleteQueue.java:567)
at
org.apache.lucene.index.DocumentsWriterDeleteQueue.updateSlice(DocumentsWriterDeleteQueue.java:286)
at
org.apache.lucene.index.DocumentsWriterPerThread.finishDocuments(DocumentsWriterPerThread.java:344)
at
org.apache.lucene.index.DocumentsWriterPerThread.updateDocuments(DocumentsWriterPerThread.java:284)
at
org.apache.lucene.index.DocumentsWriter.updateDocuments(DocumentsWriter.java:425)
at
org.apache.lucene.index.IndexWriter.updateDocuments(IndexWriter.java:1552)
at
org.apache.lucene.index.IndexWriter.updateDocument(IndexWriter.java:1837)
at
org.apache.lucene.index.IndexWriter.addDocument(IndexWriter.java:1477)
at
org.apache.lucene.index.TestSnapshotDeletionPolicy$2.run(TestSnapshotDeletionPolicy.java:302)
```
This failure might also be related to #13446 and #13127. Please apply the
following patch to reproduce the failure. It takes ~30 seconds to show the
error.
```
diff --git
a/lucene/core/src/java/org/apache/lucene/index/ConcurrentApproximatePriorityQueue.java
b/lucene/core/src/java/org/apache/lucene/index/ConcurrentApproximatePriorityQueue.java
index 8a8fc72ab4c..12e05293a19 100644
---
a/lucene/core/src/java/org/apache/lucene/index/ConcurrentApproximatePriorityQueue.java
+++
b/lucene/core/src/java/org/apache/lucene/index/ConcurrentApproximatePriorityQueue.java
@@ -38,7 +38,7 @@ final class ConcurrentApproximatePriorityQueue<T> {
int concurrency = coreCount / 4;
concurrency = Math.max(MIN_CONCURRENCY, concurrency);
concurrency = Math.min(MAX_CONCURRENCY, concurrency);
- return concurrency;
+ return 3;
}
final int concurrency;
diff --git
a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriter.java
b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriter.java
index 7955df5630e..ba3c6f0d3f0 100644
--- a/lucene/core/src/java/org/apache/lucene/index/DocumentsWriter.java
+++ b/lucene/core/src/java/org/apache/lucene/index/DocumentsWriter.java
@@ -411,8 +411,33 @@ final class DocumentsWriter implements Closeable,
Accountable {
final DocumentsWriterDeleteQueue.Node<?> delNode)
throws IOException {
boolean hasEvents = preUpdate();
+ if (Thread.currentThread().getName().contains("t9")) {
+ try {
+ Thread.sleep(100000);
+ } catch (Exception e) {}
+ }
+ if (!Thread.currentThread().getName().contains("t0")) {
+ if (Thread.currentThread().getName().contains("t1")) {
+ try {
+ Thread.sleep(5000);
+ } catch (Exception e) {}
+ } else if (Thread.currentThread().getName().contains("t2")) {
+ try {
+ Thread.sleep(5000);
+ } catch (Exception e) {}
+ } else {
+ try {
+ Thread.sleep(1000);
+ } catch (Exception e) {}
+ }
+ }
final DocumentsWriterPerThread dwpt = flushControl.obtainAndLock();
+ if (!Thread.currentThread().getName().contains("t0") &&
!Thread.currentThread().getName().contains("t1") &&
!Thread.currentThread().getName().contains("t2")) {
### Version and environment details
Commit: 33a4c1d8ef999902dacedde9c7f04a3c7e2e78c9
Java version: openjdk 21.0.3 2024-04-16
--
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]