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

Improve commitlog bootstrapping reliability in the face of sudden failures #1065

Merged
merged 15 commits into from
Oct 11, 2018

Conversation

richardartoul
Copy link
Contributor

@richardartoul richardartoul commented Oct 10, 2018

  • Prevent commit log reader from deadlocking when faced with certain types of commit log file corruption
  • Add regression property test to verify that the commit log reader never deadlocks or gets stuck regardless of any kind of random corruption

@richardartoul richardartoul requested review from prateek and robskillington and removed request for prateek October 10, 2018 21:23
@codecov
Copy link

codecov bot commented Oct 10, 2018

Codecov Report

Merging #1065 into master will increase coverage by 0.02%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1065      +/-   ##
==========================================
+ Coverage   77.35%   77.37%   +0.02%     
==========================================
  Files         541      541              
  Lines       45917    45924       +7     
==========================================
+ Hits        35518    35534      +16     
+ Misses       8142     8137       -5     
+ Partials     2257     2253       -4
Flag Coverage Δ
#aggregator 81.62% <ø> (ø) ⬆️
#collector 59.34% <ø> (ø) ⬆️
#dbnode 81.26% <87.5%> (+0.04%) ⬆️
#m3em 73.21% <ø> (ø) ⬆️
#m3ninx 75.25% <ø> (-0.08%) ⬇️
#m3nsch 51.19% <ø> (ø) ⬆️
#query 63.25% <ø> (ø) ⬆️
#x 75.1% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3bc561b...aee9342. Read the comment docs.

@@ -460,3 +460,13 @@ type BlockRetrieverOptions interface {
// IdentifierPool returns the identifierPool
IdentifierPool() ident.Pool
}

// FD is the interface implemented by *os.File.
type FD interface {
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: move this to m3/src/x/os and call it File instead of FD

Copy link
Contributor Author

Choose a reason for hiding this comment

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

good call

src/x/test/fd.go Outdated Show resolved Hide resolved
@@ -80,6 +80,13 @@ type commitLogWriter interface {
Close() error
}

type chunkWriterIface interface {
reset(f fs.FD)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: use uniform casing in method names

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Some have to be public to implement other interfaces, other methods should probably just be private...but I guess its a private interface so I guess it doesnt matter

Copy link
Collaborator

Choose a reason for hiding this comment

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

embed the interface's rather than copying methods if you can help it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

that worked actually, cheers

@@ -80,6 +80,13 @@ type commitLogWriter interface {
Close() error
}

type chunkWriterIface interface {
Copy link
Collaborator

Choose a reason for hiding this comment

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

naming nit: not a fan of the Iface - how about calling the interface chunkWriter and the usual struct fsChunkWriter?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah sure, I didn't like this either

@richardartoul richardartoul changed the title [WIP] Improve commitlog bootstrapping reliability in the face of sudden failures Improve commitlog bootstrapping reliability in the face of sudden failures Oct 10, 2018
@@ -122,12 +124,25 @@ func TestCommitLogReadWrite(t *testing.T) {
}

func TestCommitLogPropTest(t *testing.T) {
// Temporarily reduce size of buffered channels to increase change of
Copy link
Collaborator

Choose a reason for hiding this comment

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

s/change/chance/

src/x/test/fd.go Outdated Show resolved Hide resolved
src/x/test/fd.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@robskillington robskillington left a comment

Choose a reason for hiding this comment

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

LGTM

@richardartoul richardartoul merged commit c60067e into master Oct 11, 2018
@robskillington robskillington deleted the ra/fix-commitlog branch October 12, 2018 12:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants