mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Fabio Pistolesi
21.27.2015 52c7423642e0014e276e0bddc203b2e8696bc7b8
OPENDJ-2574 Error about read-only storage after creating a VLV index with some offline tasks.

VLV indexes need to open the counter Tree with the correct accessMode for the entry container.
4 files modified
12 ■■■■ changed files
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AbstractTree.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DefaultIndex.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ID2Entry.java 2 ●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java 4 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AbstractTree.java
@@ -50,11 +50,11 @@
  public final void open(WriteableTransaction txn, boolean createOnDemand) throws StorageRuntimeException
  {
    txn.openTree(name, createOnDemand);
    afterOpen(txn);
    afterOpen(txn, createOnDemand);
  }
  /** Override in order to perform any additional initialization after the index has opened. */
  void afterOpen(WriteableTransaction txn) throws StorageRuntimeException
  void afterOpen(WriteableTransaction txn, boolean createOnDemand) throws StorageRuntimeException
  {
    // Do nothing by default.
  }
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/DefaultIndex.java
@@ -98,7 +98,7 @@
  }
  @Override
  final void afterOpen(WriteableTransaction txn)
  final void afterOpen(WriteableTransaction txn, boolean createOnDemand)
  {
    final EnumSet<IndexFlag> flags = state.getIndexFlags(txn, getName());
    codec = flags.contains(COMPACTED) ? CODEC_V2 : CODEC_V1;
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/ID2Entry.java
@@ -248,7 +248,7 @@
  }
  @Override
  void afterOpen(WriteableTransaction txn) throws StorageRuntimeException
  void afterOpen(WriteableTransaction txn, boolean createOnDemand) throws StorageRuntimeException
  {
    // Make sure the tree is there and readable, even if the storage is READ_ONLY.
    // Would be nice if there were a better way...
opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/VLVIndex.java
@@ -163,9 +163,9 @@
  }
  @Override
  void afterOpen(final WriteableTransaction txn) throws StorageRuntimeException
  void afterOpen(final WriteableTransaction txn, boolean createOnDemand) throws StorageRuntimeException
  {
    counter.open(txn, true);
    counter.open(txn, createOnDemand);
  }
  @Override