Skip to content
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

Re-open last WAL segment #9464

Merged
merged 1 commit into from
Feb 20, 2018
Merged

Re-open last WAL segment #9464

merged 1 commit into from
Feb 20, 2018

Conversation

jwilder
Copy link
Contributor

@jwilder jwilder commented Feb 20, 2018

Re-open the last wal segment instead of creating a new one. This fixes
an issue where the last modified time of the WAL would change on
restart. It also avoids a lot of IO file churn on restart.

Fixes #9333

Required for all non-trivial PRs
  • Sign CLA (if not already signed)
Required only if applicable

You can erase any checkboxes below this note if they are not applicable to your Pull Request.

  • InfluxQL Spec updated
  • Provide example syntax
  • Update man page when modifying a command
  • Config changes: update sample config (etc/config.sample.toml), server NewDemoConfig method, and Diagnostics methods reporting config settings, if necessary
  • InfluxData Documentation: issue filed or pull request submitted <link to issue or pull request>

@jwilder jwilder added this to the 1.5.0 milestone Feb 20, 2018
@jwilder jwilder requested a review from joelegasse February 20, 2018 16:49
@ghost ghost assigned jwilder Feb 20, 2018
@ghost ghost added the review label Feb 20, 2018
@jwilder jwilder force-pushed the jw-wal-lastmodified branch 4 times, most recently from 8a1b867 to 577da57 Compare February 20, 2018 18:13
Copy link
Contributor

@joelegasse joelegasse left a comment

Choose a reason for hiding this comment

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

Looks good overall, just a redundant call to Round on the timestamps

@@ -228,7 +237,7 @@ func (l *WAL) Open() error {
if stat.Size() > 0 {
totalOldDiskSize += stat.Size()
if stat.ModTime().After(l.lastWriteTime) {
l.lastWriteTime = stat.ModTime().UTC()
l.lastWriteTime = stat.ModTime().Round(0).UTC()
Copy link
Contributor

Choose a reason for hiding this comment

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

The Round(0) is unnecessary. It returns the time unchanged while stripping the monotonic portion, but UTC() also strips the monotonic portion.

@jwilder jwilder force-pushed the jw-wal-lastmodified branch 6 times, most recently from 4a7bd6f to f444f22 Compare February 20, 2018 21:00
Re-open the last wal segment instead of creating a new one.  This fixes
an issue where the last modified time of the WAL would change on
restart.  It also avoids a lot of IO file churn on restart.
@jwilder jwilder force-pushed the jw-wal-lastmodified branch from f444f22 to f7279b5 Compare February 20, 2018 21:24
@jwilder jwilder merged commit 2af4389 into master Feb 20, 2018
@ghost ghost removed the review label Feb 20, 2018
@jwilder jwilder deleted the jw-wal-lastmodified branch February 20, 2018 21:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Revisit logic in TSM LastModified test
2 participants