vocdoni-node
vocdoni-node copied to clipboard
PebbleDB.ReadTx uses a pebble.Batch
The implementation of Database with Pebble currently uses an IndexedBatch for a ReadTx: https://github.com/vocdoni/vocdoni-node/blob/626c8984df6dd0bd78787d37ab27ad62f7df76e8/db/pebbledb/pebledb.go#L108
This is a bit strange because an IndexedBatch has some extra logic to handle writes and read from those written keys, but we're only reading here. Also, a Batch is not a Transaction, so we don't get a view at a particular point in time. Why not just store a pointer to the db in the ReadTx to avoid the overhead of creating an IndexedBatch?
@mvdan @arnaucube any updates on this ?
This is a potential problem/enhancement that we should look into at some point, so it's in our backlog. There are no updates. I'm goning to unassign the two of us to clarify we are not working on this right now.