Bryan Stopp created OAK-9660:
--------------------------------
Summary: NPE When Moving Transient node
Key: OAK-9660
URL: https://issues.apache.org/jira/browse/OAK-9660
Project: Jackrabbit Oak
Issue Type: Bug
Components: core
Affects Versions: 1.40.0, 1.8.8
Reporter: Bryan Stopp
When a node is moved in a uncommitted Session1 (S), that was previously moved
in a closed/committed Session2 (S'), any transient children nodes that are
moved throw NPEs in the node memory manager tracking the uncommitted state.
Steps to reproduce:
# Start Sling docker container
## ` docker run -p 8080:8080 apache/sling`
# Install [demo project|https://github.com/bstopp/oak-move-bug]
# Navigate to the [Demo servlet|http://localhost:8080/bin/bug/test]
The servlet will catch the NPE and display it. The error occurs
[here|https://github.com/apache/jackrabbit-oak/blob/74a1a686635be76b74abd57ebc0ef1dd4bb44889/oak-store-spi/src/main/java/org/apache/jackrabbit/oak/plugins/memory/MemoryNodeBuilder.java#L449].
`base` is not null, but `head` is.
It seems that the `base` look up finds the segment metadata from Session1 (S)
that has been dispatched (before the current session was created), and not
recognizing that the parent is now a transient node in Session2 (S').
--
This message was sent by Atlassian Jira
(v8.20.1#820001)