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

Migrate write ahead log - #340

Merged
fabxc merged 4 commits into
newwalfrom
wal_migrate
Aug 2, 2018
Merged

Migrate write ahead log#340
fabxc merged 4 commits into
newwalfrom
wal_migrate

Conversation

@fabxc

@fabxc fabxc commented May 29, 2018

Copy link
Copy Markdown
Contributor

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

@jkohen @brian-brazil

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

Copy link
Copy Markdown

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

krasi-georgiev commented May 30, 2018

Copy link
Copy Markdown
Contributor

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

fabxc commented May 30, 2018 via email

Copy link
Copy Markdown
Contributor Author

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 <freinartz@google.com>
Signed-off-by: Fabian Reinartz <freinartz@google.com>
Signed-off-by: Fabian Reinartz <freinartz@google.com>
@fabxc

fabxc commented Jul 19, 2018

Copy link
Copy Markdown
Contributor Author

Rebased and resolved conflicts.

Comment thread wal.go

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

s/coders/codex/

Comment thread 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
Copy Markdown
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

Comment thread wal.go
if err := repl.Close(); err != nil {
return errors.Wrap(err, "close new WAL")
}
if err := fileutil.Rename(tmpdir, dir); err != nil {

Copy link
Copy Markdown
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 <freinartz@google.com>
@fabxc

fabxc commented Aug 2, 2018

Copy link
Copy Markdown
Contributor Author

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