From 8c65daf79d1c7fbe47f556c4d4bba2c2859851d1 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.
---
opends/src/server/org/opends/server/backends/jeb/IndexRebuildThread.java | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/opends/src/server/org/opends/server/backends/jeb/IndexRebuildThread.java b/opends/src/server/org/opends/server/backends/jeb/IndexRebuildThread.java
index aebf876..4696030 100644
--- a/opends/src/server/org/opends/server/backends/jeb/IndexRebuildThread.java
+++ b/opends/src/server/org/opends/server/backends/jeb/IndexRebuildThread.java
@@ -569,7 +569,7 @@
dn2uri.targetEntryReferrals(entry.getDN(), null);
// Read the parent ID from dn2id.
- EntryID parentID = dn2id.get(txn, parentDN);
+ EntryID parentID = dn2id.get(txn, parentDN, LockMode.DEFAULT);
if (parentID != null)
{
// Insert into id2children for parent ID.
@@ -684,7 +684,7 @@
dn2uri.targetEntryReferrals(entry.getDN(), null);
// Read the parent ID from dn2id.
- EntryID parentID = dn2id.get(txn, parentDN);
+ EntryID parentID = dn2id.get(txn, parentDN, LockMode.DEFAULT);
if (parentID != null)
{
// Insert into id2subtree for parent ID.
@@ -700,7 +700,7 @@
dn = ec.getParentWithinBase(dn))
{
// Read the ID from dn2id.
- EntryID nodeID = dn2id.get(null, dn);
+ EntryID nodeID = dn2id.get(null, dn, LockMode.DEFAULT);
if (nodeID != null)
{
// Insert into id2subtree for this node.
@@ -921,7 +921,7 @@
skippedEntries++;
Message message = ERR_JEB_REBUILD_INSERT_ENTRY_FAILED.get(
- index.getName(), stackTraceToSingleLineString(e));
+ vlvIndex.getName(), stackTraceToSingleLineString(e));
logError(message);
if (debugEnabled())
--
Gitblit v1.10.0