COWEpoch are inner object. When a CopyOnWriteManager is cloned, the new COWEpoch for the clone is created by the initial object rather than the clone. I believe this is wrong, and leads to problem when later the COWEpoch affects _active (in onClosed), affecting the original object rather than the clone.
The commit includes a small unit test demonstrating the bug (I got lazy and created a SnapTree test bug it's likely possible to simply have CopyOnWriteManagerTest), as well as a simple fix.
COWEpoch are inner object. When a CopyOnWriteManager is cloned, the new COWEpoch for the clone is created by the initial object rather than the clone. I believe this is wrong, and leads to problem when later the COWEpoch affects _active (in onClosed), affecting the original object rather than the clone.
The commit includes a small unit test demonstrating the bug (I got lazy and created a SnapTree test bug it's likely possible to simply have CopyOnWriteManagerTest), as well as a simple fix.