OPENDJ-2548: DirectoryException while rebuilding index on PDB instance
Due to nested transaction, attributes added in the compressed-schema
during a replaceEntry might be removed in case of a database rollback
caused, for example, by optimistic lock conflict. Problem is that
compressed-schema maintain also an in-memory cache of the attributes
which becomes inconsistent after those rollback.
The fix perform the entry encoding (and as such, the compressed-schema
modification) outside the replaceEntry transaction.
| | |
| | | throws StorageRuntimeException, DirectoryException, CanceledOperationException |
| | | { |
| | | final IndexBuffer indexBuffer = new IndexBuffer(); |
| | | final ByteString encodedNewEntry = id2entry.encode(newEntry); |
| | | try |
| | | { |
| | | storage.write(new WriteOperation() |
| | |
| | | } |
| | | |
| | | // Ensure same ordering as deleteEntry: id2entry, dn2uri, then indexes. |
| | | id2entry.put(txn, entryID, newEntry); |
| | | id2entry.put(txn, entryID, encodedNewEntry); |
| | | |
| | | // Update the referral tree. |
| | | if (modifyOperation != null) |