vocdoni-node icon indicating copy to clipboard operation
vocdoni-node copied to clipboard

PebbleDB.ReadTx uses a pebble.Batch

Open ed255 opened this issue 3 years ago • 2 comments

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?

ed255 avatar Oct 19 '21 11:10 ed255

@mvdan @arnaucube any updates on this ?

jordipainan avatar Mar 03 '22 11:03 jordipainan

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.

mvdan avatar Mar 23 '22 10:03 mvdan