forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This change adds a tracing library for raft messages. Specifically it allows registering an entry either directly or due to a remote raft message and then possibly tracing the message at various key points. When the message is finally unregistered, it will dump the trace to the log. Additionally, on a local message, it will add the trace to the context that is passed in. Fixes: cockroachdb#104035 Release note: None
- Loading branch information
1 parent
01213eb
commit fc7487e
Showing
5 changed files
with
864 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") | ||
|
||
go_library( | ||
name = "rafttrace", | ||
srcs = ["rafttrace.go"], | ||
importpath = "github.com/cockroachdb/cockroach/pkg/kv/kvserver/rafttrace", | ||
visibility = ["//visibility:public"], | ||
deps = [ | ||
"//pkg/kv/kvpb", | ||
"//pkg/kv/kvserver/kvserverpb", | ||
"//pkg/raft", | ||
"//pkg/raft/raftpb", | ||
"//pkg/settings", | ||
"//pkg/settings/cluster", | ||
"//pkg/util/log", | ||
"//pkg/util/syncutil", | ||
"//pkg/util/tracing", | ||
"//pkg/util/tracing/tracingpb", | ||
"@com_github_cockroachdb_logtags//:logtags", | ||
"@com_github_cockroachdb_redact//:redact", | ||
], | ||
) | ||
|
||
go_test( | ||
name = "rafttrace_test", | ||
srcs = ["rafttrace_test.go"], | ||
embed = [":rafttrace"], | ||
deps = [ | ||
"//pkg/kv/kvpb", | ||
"//pkg/kv/kvserver/kvserverpb", | ||
"//pkg/raft/raftpb", | ||
"//pkg/settings/cluster", | ||
"//pkg/testutils", | ||
"//pkg/util/tracing", | ||
"//pkg/util/tracing/tracingpb", | ||
"@com_github_stretchr_testify//require", | ||
], | ||
) |
Oops, something went wrong.