-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
BZ1 Pt. II #3544
BZ1 Pt. II #3544
Conversation
if err := e.writeBlocks(bkt, a); err != nil { | ||
return fmt.Errorf("append blocks: %s", err) | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the fast path. It grabs the last block in the bucket, reads the first 8 bytes (which is the ending timestamp), and if the minimum time for the inserted points is greater than that then it can simply append new blocks.
Otherwise it's a big PITA to read out and reinsert blocks as you can see below.
} | ||
|
||
// Delete block in database. | ||
c.Delete() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just want to confirm that I'm reading this right. Because this happens in a transaction, the Delete
and then the creation of a new block will be atomic?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes
Big one, but looks great. Just a few questions I had above. |
👏 👏 👏 |
Overview
This pull request is another attempt at the
bz1
engine. The original can be found at #3461.This approach changes the engine to support an underlying WAL which is being moved out to a separate package. The WAL work is being done by @pauldix. The
bz1
engine now supports a passthrough interface to aPointsWriter
(which will be the WAL) and implements a function that the WAL periodically calls back to:Implementation
The
WriteIndex()
function supports two separate write paths:There are two separate paths because most of the time users will be writing new data to the end of a series. The slow path mainly exists so that data can be backfilled.
TODO
testing/quick
black box testing