Description
I don't have a reproducible test case yet, but it looks like some usage pattern (for example creating, deleting, moving many nodes in one transaction) can cause the counter index to get out of sync with the real data. Worst case, the counter index thinks that the repository is empty (the root node has no descendent nodes).
I want to write test cases to find the problem, or to prove that it doesn't get out of sync.