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

Jean-Noël Rouvignac
27.34.2015 815a836ed89f450f9949d1a40bb99ec3e7889e2e
refs
author Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Tuesday, October 27, 2015 14:34 +0100
committer Jean-Noël Rouvignac <jean-noel.rouvignac@forgerock.com>
Tuesday, October 27, 2015 16:19 +0100
commit815a836ed89f450f9949d1a40bb99ec3e7889e2e
tree 904c0d46f9743f9b04c11ff978145e0eb6433394 tree | zip | gz
parent 74c27ef05a1a1b54a17792cd568699040ea5985b view | diff
OPENDJ-2297 OpenDJ 2.x -> 3.0 upgrade fails when there are VLV indexes

JE serializes comparators inside the JE environment.
After upgrade from local-db to pluggable JE backend, we want to remove nearly all databases created with the local-db-backend.
In order to do this, we first need to open the environment and delete databases.
On opening the environment, JE tries to deserialize the comparators.
This fails because the classes in opendj-legacy are not serialization-compatible with the previous classes in opendj-server-legacy.

There were 2 issues that prevented serialization-compatibility:
- *OrderingMatchingRule classes had to implement Serializable
- *OrderingMatchingRule classes were missing the same values for serialVersionUID fields

This fix was successfully tested with a VLV index with the following search filter:
"(&(uid>=user.*)(photo>=*)(numSubordinates<=1)(entryUUID>=*)(modifyTimestamp>=0)(etag>=*)(internationaliSDNNumber>=*))"
This tests the following ordering matches:
"caseIgnoreMatch octetStringMatch integerOrderingMatch uuidOrderingMatch generalizedTimeOrderingMatch caseExactMatch"
Which tests the following ordering matching rule implementations:
"CaseIgnoreOrderingMatchingRule OctetStringOrderingMatchingRule IntegerOrderingMatchingRule UUIDOrderingMatchingRule GeneralizedTimeOrderingMatchingRule CaseExactOrderingMatchingRule NumericStringOrderingMatchingRule"
I am only missing HistoricalCsnOrderingMatchingRule

Note:
When removing the local-db-backend, we will have to move the VLV comparator to the opendj-legacy module.
We can remove all methods, but we will need to retain the serialVersionUID and possibly some fields (to be tested).

*OrderingMatchingRule.java:
Added back serialVersionUID fields.

DummyByteArrayComparator.java:
Implemented Serializable, so all *OrderingMatchingRule classes also do

VLVKeyComparator.java:
During deserialization a NPE was thrown.
10 files modified
43 ■■■■ changed files
opendj-legacy/src/main/java/org/opends/legacy/DummyByteArrayComparator.java 8 ●●●●● diff | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/replication/plugin/HistoricalCsnOrderingMatchingRule.java 4 ●●●● diff | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/schema/CaseExactOrderingMatchingRule.java 4 ●●●● diff | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/schema/CaseIgnoreOrderingMatchingRule.java 4 ●●●● diff | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/schema/GeneralizedTimeOrderingMatchingRule.java 4 ●●●● diff | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/schema/IntegerOrderingMatchingRule.java 4 ●●●● diff | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/schema/NumericStringOrderingMatchingRule.java 4 ●●●● diff | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/schema/OctetStringOrderingMatchingRule.java 4 ●●●● diff | view | raw | blame | history
opendj-legacy/src/main/java/org/opends/server/schema/UUIDOrderingMatchingRule.java 4 ●●●● diff | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/VLVKeyComparator.java 3 ●●●● diff | view | raw | blame | history