-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
b*1 to TSM converter #5226
b*1 to TSM converter #5226
Conversation
85b21eb
to
1ffcbd3
Compare
de2965c
to
7e6ea23
Compare
@david @pauldix @jwilder @benbjohnson -- this utility is ready to go. There is a fair chunk of code here, but much of it is copy-n-paste. |
This utility is ready to go. There is a fair chunk of code here, but much of it is copy-n-paste. |
LGTM, let the testing begin!! |
@jwilder also reviewed an early draft of |
I briefly looked over it and it lgtm. However, I would suggest adding a lot of logging. If we get bug reports then they're going to be hard to track down without any logging. |
@benbjohnson -- I will review the code for places I should add more output to help the user in the case of failure. |
I ran Conversion by
|
I double-checked the code. All errors bubble up the stack, and are clearly associated with the failing shard. I'd like to get this merged now, and see how if goes during our testing. Then I will see operationally where the logging needs to be enhanced. |
if err != nil { | ||
return err | ||
} | ||
defer w.Close() |
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.
Won't this miss a call to Close
if the file rolls over on L61? It may also double close the file.
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.
Yeah, the potential double-close is an issue. Let me fix that up.
Started with #5159
This tool converts, on a database-by-database basis, b1 and bz1 shards to tsm format. The main components include:
Each reader exposes an iterator such that the emitted chunks are suitable for feeding directly into a
TSMWriter
-- the series keys are a combination of the measurement, tag-set, and field. Series keys are arranged alphabetically, and timestamps of all points are increasing, as required by TSMWriters.A database is backed-up before any changes are made to it.
Much of this work involved copying existing b1 and bz1 code, so as to avoid conflicts with changes to that code (which will going away soon). There is also much duplication between the b1 and bz readers. This could be factored out if necessary, but simplicity and correctness seems key for this tool.
Remaining
Example output: