fdb-record-layer icon indicating copy to clipboard operation
fdb-record-layer copied to clipboard

DirectoryLayerDirectory creates new transactions during reverse lookup

Open alecgrieser opened this issue 2 years ago • 0 comments

The DirectoryLayerDirectory currently creates a new transaction when it does a reverse lookup here:

https://github.com/FoundationDB/fdb-record-layer/blob/036443fe91fe822422fe0d732bfade3c91d68441/fdb-record-layer-core/src/main/java/com/apple/foundationdb/record/provider/foundationdb/keyspace/DirectoryLayerDirectory.java#L282-L285

This is from an older time when the LocatableResolver didn't support reverse lookups without creating a new transaction. (See #1714.) Now, however, if it is given an already initialized transaction, it can borrow the read version from that transaction to avoid the cost of initializing a new transaction.

alecgrieser avatar Oct 04 '22 10:10 alecgrieser