Improve batching in badger #636

Closed
opened 2023-08-22 08:30:42 +00:00 by fyrchik · 1 comment
Owner

Batch() in bolt accumulates tx from different goroutines implicitly, so they are grouped and synced together.
AFAIK badger does no such thing, so we may want add grouping in our own code.

My suggestion:

  1. Writecache has a global Batch instance and flush channel.
  2. After some time or elements accumulated batch is flushed.
  3. Caller receives an error from some flushCh belonging to a batch (all batches receive the same error, but make sure to handle ErrTxnTooBig on the caller -- we may fallback to a simple Set in this case.

Related #627.

`Batch()` in bolt accumulates tx from different goroutines implicitly, so they are grouped and synced together. AFAIK badger does no such thing, so we may want add grouping in our own code. My suggestion: 1. Writecache has a global `Batch` instance and flush channel. 2. After some time or elements accumulated batch is flushed. 3. Caller receives an error from some `flushCh` belonging to a batch (all batches receive the same error, but make sure to handle `ErrTxnTooBig` on the caller -- we may fallback to a simple `Set` in this case. Related #627.
fyrchik added the
frostfs-node
triage
badger
labels 2023-08-22 08:30:42 +00:00
fyrchik removed the
triage
label 2023-08-25 11:18:18 +00:00
fyrchik added this to the v0.38.0 milestone 2023-08-28 14:25:24 +00:00
fyrchik removed this from the v0.38.0 milestone 2024-02-12 06:35:43 +00:00
Author
Owner

Not needed after #887

Not needed after #887
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: TrueCloudLab/frostfs-node#636
No description provided.