When attempting to call directory.createOrOpen for a non-existent directory multiple times in a single transaction in parallel, two different subspaces are created. Only one of them gets referenced by the directory path. The other one becomes orphan.
Reproduction code:
const foundationdb = open();
const [dir1, dir2] = await foundationdb.doTransaction(tn =>
Promise.all([
directory.createOrOpen(tn, ['test']),
directory.createOrOpen(tn, ['test']),
]),
);
expect(dir1.content.prefix).toEqual(dir2.content.prefix); // fails
When attempting to call
directory.createOrOpenfor a non-existent directory multiple times in a single transaction in parallel, two different subspaces are created. Only one of them gets referenced by the directory path. The other one becomes orphan.Reproduction code: