Skip to content
This repository has been archived by the owner on Aug 13, 2019. It is now read-only.

Migrate write ahead log #340

Merged
merged 4 commits into from
Aug 2, 2018
Merged

Migrate write ahead log #340

merged 4 commits into from
Aug 2, 2018

Conversation

fabxc
Copy link
Contributor

@fabxc fabxc commented May 29, 2018

On startup, rewrite the old write ahead log into the new format once.

@jkohen @brian-brazil

wal.go Outdated
if err != nil {
return errors.Wrap(err, "write new entries")
}
if err := w.Close(); err != nil {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you want to close both WALs regardless of errors?

@krasi-georgiev
Copy link
Contributor

krasi-georgiev commented May 30, 2018

I was thinking that with more versions and more changes this repair/convert logics might "contaminate" 💩 the code. Why not add this as part of the tsdb cli tool?

I have already added tsdb scan so maybe something like tsdb upgrade

@fabxc
Copy link
Contributor Author

fabxc commented May 30, 2018 via email

Fabian Reinartz added 3 commits July 19, 2018 07:34
On startup, rewrite the old write ahead log into the new format once.

Signed-off-by: Fabian Reinartz <[email protected]>
Signed-off-by: Fabian Reinartz <[email protected]>
Signed-off-by: Fabian Reinartz <[email protected]>
@fabxc
Copy link
Contributor Author

fabxc commented Jul 19, 2018

Rebased and resolved conflicts.

@@ -173,6 +176,8 @@ func newCRC32() hash.Hash32 {
}

// SegmentWAL is a write ahead log for series data.
//
// DEPRECATED: use wal pkg combined with the record coders instead.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/coders/codex/

wal.go Outdated
if err != nil {
return errors.Wrap(err, "open new WAL")
}
// We close it once already before as part of finalization.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't read properly

if err := repl.Close(); err != nil {
return errors.Wrap(err, "close new WAL")
}
if err := fileutil.Rename(tmpdir, dir); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This no longer works given that dir already exists and Rename no longer deletes the destination first.

Signed-off-by: Fabian Reinartz <[email protected]>
@fabxc
Copy link
Contributor Author

fabxc commented Aug 2, 2018

Merging this into the branch for the new WAL so we can have a final pass over all changes together.

@fabxc fabxc merged commit 7699051 into newwal Aug 2, 2018
@fabxc fabxc deleted the wal_migrate branch August 2, 2018 21:58
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants