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
Add a tsdb writer interface #7950
Conversation
Signed-off-by: jessicagreben <jessicagrebens@gmail.com>
We shouldn't be adding dead code, PRs should generally make sense standalone. Maybe there's some tests that could use it? |
Is that the same as teststorage? |
what is the reason to extract it from above PR's? |
@brian-brazil while looking for a some tests that could use this code, I came across this code: It doesn't seem like we need both of these implementations since they are mostly the same. I will close this PR and use the tsdbblockutil code in #7675 instead. @roidelapluie I wanted to extract it from the above PRs just to get it merged in easier. |
@JessicaGreben Note that functions in tsdbblockutil require all samples to be presented beforehand. It would be nice (or even a requirement) to make them iterators for streaming samples for the backfill. |
Happy to reuse more, but we might want to add there some writer like we did in our PRs, for streaming / appender functionality indeed. |
If the writer interface is more handy for backfilling purposes (which I would believe so), I would say let's re-open and have the writer interface as is and use it inside |
(Which means we need to remove |
Signed-off-by: jessicagreben <jessicagrebens@gmail.com>
39b38cd
to
cd89cfe
Compare
Signed-off-by: jessicagreben <jessicagrebens@gmail.com>
Ok so I just added the change to use the block writer in the tsdbblockutil code, but still nothing is using the tsdbblockutil code. So I'm going to see if I can fix that by adding it to a test. Also I will add some other tests for this writer code. |
I think block_test.go uses it |
@codesome I don't see the code from tsdbblockutil.go used in block_test.go, but looks like it might be easy to add, let me add that |
Just came across this Lines 303 to 349 in b014588
We can get rid of this and bring back |
Signed-off-by: jessicagreben <jessicagrebens@gmail.com>
074a2dd
to
eca7d38
Compare
Signed-off-by: jessicagreben <jessicagrebens@gmail.com>
Signed-off-by: jessicagreben <jessicagrebens@gmail.com>
Signed-off-by: jessicagreben <jessicagrebens@gmail.com>
@codesome Thanks for your help and comments 😄 I think I addressed all your comments. When/if you have any free time, it would be great to get another review from you. About your last comment (re:#7950 (comment)), I ended up not deleting the function since it resulted in a lot of changes. Instead I call the tsdbblockutil |
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.
Almost there! Some nits and we need to update the test.
Additionally, we are still requiring initHead
to be called from outside. It should be part of NewBlockWriter
.
Signed-off-by: jessicagreben <jessicagrebens@gmail.com>
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 perfect from my side. Thanks for this @JessicaGreben ❤️
LGTM!
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.
LGTM! Couple of nits, in test and the about duration which Brian mentioned
Signed-off-by: jessicagreben <jessicagrebens@gmail.com>
@codesome thanks for your help. I addressed the final comments. Let me know what you think...hopefully we can merge :) |
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 PR adds one file from #7586 that is copy/pasted into another PR #7675 .
The change in the PR adds a tsdb writer interface and also a tsdbWriter object that implements the interface. This is nice to have so we have a simple wrapper around writing time series to tsdb blocks.
Signed-off-by: jessicagreben jessicagrebens@gmail.com