lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [23/46] lucene-solr:jira/solr-11833: LUCENE-8233: Never reset initiazlized DV gen
Date Mon, 16 Apr 2018 17:21:03 GMT
LUCENE-8233: Never reset initiazlized DV gen

We drop changes after we finish a merge, this has also reset
the DV generation the PendingSoftDeletes were initialized on causing
assertions to trip if releaseing the reader was writing DV to disk.
This change removes resetting the dv generation to make assertions
hold which requried to keep the pending change count on PendingSoftDeletes.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/d5b68576
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/d5b68576
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/d5b68576

Branch: refs/heads/jira/solr-11833
Commit: d5b68576034ee9ee936e1e712639212a3a04f73f
Parents: f41e7c4
Author: Simon Willnauer <simonw@apache.org>
Authored: Fri Apr 13 09:30:32 2018 +0200
Committer: Simon Willnauer <simonw@apache.org>
Committed: Fri Apr 13 09:34:33 2018 +0200

----------------------------------------------------------------------
 .../src/java/org/apache/lucene/index/PendingDeletes.java     | 4 ++--
 .../src/java/org/apache/lucene/index/PendingSoftDeletes.java | 8 ++++----
 .../src/java/org/apache/lucene/index/ReadersAndUpdates.java  | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5b68576/lucene/core/src/java/org/apache/lucene/index/PendingDeletes.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/PendingDeletes.java b/lucene/core/src/java/org/apache/lucene/index/PendingDeletes.java
index fca42b4..52d06e8 100644
--- a/lucene/core/src/java/org/apache/lucene/index/PendingDeletes.java
+++ b/lucene/core/src/java/org/apache/lucene/index/PendingDeletes.java
@@ -166,7 +166,7 @@ class PendingDeletes {
   /**
    * Resets the pending docs
    */
-  void reset() {
+  void dropChanges() {
     pendingDeleteCount = 0;
   }
 
@@ -223,7 +223,7 @@ class PendingDeletes {
     // (successfully written) del docs:
     info.advanceDelGen();
     info.setDelCount(info.getDelCount() + pendingDeleteCount);
-    reset();
+    dropChanges();
     return true;
   }
 

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5b68576/lucene/core/src/java/org/apache/lucene/index/PendingSoftDeletes.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/PendingSoftDeletes.java b/lucene/core/src/java/org/apache/lucene/index/PendingSoftDeletes.java
index 0d7852b..4c3db48 100644
--- a/lucene/core/src/java/org/apache/lucene/index/PendingSoftDeletes.java
+++ b/lucene/core/src/java/org/apache/lucene/index/PendingSoftDeletes.java
@@ -88,10 +88,10 @@ final class PendingSoftDeletes extends PendingDeletes {
   }
 
   @Override
-  void reset() {
-    dvGeneration = -2;
-    super.reset();
-    hardDeletes.reset();
+  void dropChanges() {
+    // don't reset anything here - this is called after a merge (successful or not) to prevent
+    // rewriting the deleted docs to disk. we only pass it on and reset the number of pending
deletes
+    hardDeletes.dropChanges();
   }
 
   /**

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/d5b68576/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java
----------------------------------------------------------------------
diff --git a/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java b/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java
index 6dc8864..b236bea 100644
--- a/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java
+++ b/lucene/core/src/java/org/apache/lucene/index/ReadersAndUpdates.java
@@ -287,7 +287,7 @@ final class ReadersAndUpdates {
     // is running, by now we have carried forward those
     // deletes onto the newly merged segment, so we can
     // discard them on the sub-readers:
-    pendingDeletes.reset();
+    pendingDeletes.dropChanges();
     dropMergingUpdates();
   }
 


Mime
View raw message