From d84ee43ec8ab4e6ecdad2f0ef0d64dac54f7d6af Mon Sep 17 00:00:00 2001
From: boli <boli@localhost>
Date: Mon, 21 Apr 2008 21:08:12 +0000
Subject: [PATCH] This patch adds index buffering capabilities to the JE backend as to avoid using a fixed lock timeout for subtree delete and mod DN operations. Previously, any index modifications to subordinate entries of the affected operations will be performed with dn2id and id2entry modifications. This creates multiple random access to index database keys which could cause deadlocks in face of multiple parallel operations. With this fix, all index modifications are buffered up until the end of the operation so that each key of each index will be accessed once and in order. This maintains the DB access ordering in the JE backend of dn2id, id2entry, dn2uri, indexes in config order, VLV indexes in config order, and finally id2children and id2subtree. Since deadlocks should no longer occur in the JE backend, JE lock timeouts are now disabled at the JE environment level instead of the txn level. With this change, the performance of subtree deletes and mod DN operations have increased dramatically.
---
opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/DNContext.java | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/DNContext.java b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/DNContext.java
index 3924313..8f95554 100644
--- a/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/DNContext.java
+++ b/opendj-sdk/opends/src/server/org/opends/server/backends/jeb/importLDIF/DNContext.java
@@ -35,6 +35,7 @@
import com.sleepycat.je.DatabaseException;
import com.sleepycat.je.Transaction;
+import com.sleepycat.je.LockMode;
import java.util.concurrent.BlockingQueue;
import java.util.concurrent.ConcurrentHashMap;
@@ -468,7 +469,7 @@
return null;
}
}
- parentID = dn2id.get(txn, parentDN);
+ parentID = dn2id.get(txn, parentDN, LockMode.DEFAULT);
//If the parent is in dn2id, add it to the cache.
if (parentID != null) {
synchronized(synchObject) {
--
Gitblit v1.10.0