-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Diagnose Raft WAL via debug tool #3319
Conversation
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.
Reviewed 2 of 2 files at r1.
Reviewable status: 1 of 2 files reviewed, 4 unresolved discussions (waiting on @manishrjain and @martinmr)
dgraph/cmd/debug/run.go, line 680 at r1 (raw file):
gid := binary.BigEndian.Uint32(key[8:12]) gids[gid] = true }
I would add a default case in case there are keys not of this size and either return an error or print the key for debugging. There shouldn't be but there could be in case of bugs I suppose.
dgraph/cmd/debug/run.go, line 697 at r1 (raw file):
return err } fmt.Printf("rids: %v\n", rids)
How big are these maps usually? Will the output be readable if these maps are too big. Also, this will print the values, which I assume are all irrelevant since the map is acting as a set.
dgraph/cmd/debug/run.go, line 779 at r1 (raw file):
64<<20)
what's this supposed to represent?
dgraph/cmd/debug/run.go, line 835 at r1 (raw file):
} // WAL can't execute the following function.
maybe move this comment to the return above so its intent is clearer.
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.
Reviewed 1 of 1 files at r2.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @manishrjain)
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.
Reviewable status: all files reviewed, 4 unresolved discussions (waiting on @martinmr)
dgraph/cmd/debug/run.go, line 680 at r1 (raw file):
Previously, martinmr (Martin Martinez Rivera) wrote…
I would add a default case in case there are keys not of this size and either return an error or print the key for debugging. There shouldn't be but there could be in case of bugs I suppose.
Done. There are other keys, we just don't care. Have added a comment there to make it clear.
dgraph/cmd/debug/run.go, line 697 at r1 (raw file):
Previously, martinmr (Martin Martinez Rivera) wrote…
How big are these maps usually? Will the output be readable if these maps are too big. Also, this will print the values, which I assume are all irrelevant since the map is acting as a set.
We only expect one raft id and one group id. But, if this WAL was used for something else before, we'd get to know via this list.
dgraph/cmd/debug/run.go, line 779 at r1 (raw file):
Previously, martinmr (Martin Martinez Rivera) wrote…
64<<20)
what's this supposed to represent?
Done. Added a comment.
dgraph/cmd/debug/run.go, line 835 at r1 (raw file):
Previously, martinmr (Martin Martinez Rivera) wrote…
maybe move this comment to the return above so its intent is clearer.
Done.
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.
Reviewed 1 of 1 files at r4.
Reviewable status: complete! all files reviewed, all discussions resolved
This PR adds a way to print out the Raft WAL for both Alpha and Zero, so we can get a better understanding of how data is flowing through the system and diagnose issues.
This PR adds a way to print out the Raft WAL so we can get a better understanding of how data is flowing through the system.
This change is