OPENDJ-1375 CR-4618: prevent deadlocks when updating id2subtree using IndexBuffers
Lock entry ID keys in descending order (children then parents) in order to be
consistent with id2subtree updates performed for single entry add and delete
operations.
| | |
| | | |
| | | if(bufferedValues != null) |
| | | { |
| | | /* |
| | | * OPENDJ-1375: add keys in reverse order to be consistent with single |
| | | * entry processing in add/delete processing. This is necessary in order |
| | | * to avoid deadlocks. |
| | | */ |
| | | Iterator<Map.Entry<ByteString, BufferedIndexValues>> keyIterator = |
| | | bufferedValues.entrySet().iterator(); |
| | | bufferedValues.descendingMap().entrySet().iterator(); |
| | | while(keyIterator.hasNext()) |
| | | { |
| | | Map.Entry<ByteString, BufferedIndexValues> bufferedKey = |