core: plug logtree into NodeDebugService
This introduces a new Proto API for accessing debug logs. Currently this
is implemented to be used by the debug service. However, these proto
definitions will likely be reused for production cluster APIs.
The implementation mostly consists of adding the proto, implementing
to/from conversion methods, and altering the debug service to use the
new API.
We also move all of the debug service implementation into a separate file,
to slightly clean up main.go. This produces an unfortunately colorful
diff, but it's just moving code around.
Test Plan: Manually tested using the dbg tool. We currently don't properly test the debug service. I suppose we should do that for the production cluster APIs, and just keep on going for now.
X-Origin-Diff: phab/D649
GitOrigin-RevId: ac454681e4b72b2876e313b3aeababa179eb1fa3
diff --git a/core/pkg/logtree/logtree.go b/core/pkg/logtree/logtree.go
index 064b6e7..2d405f8 100644
--- a/core/pkg/logtree/logtree.go
+++ b/core/pkg/logtree/logtree.go
@@ -66,6 +66,8 @@
tree: tree,
children: make(map[string]*node),
}
+ // TODO(q3k): make this limit configurable. If this happens, or the default (1024) gets changes, max chunk size
+ // calculations when serving the logs (eg. in NodeDebugService) must reflect this.
n.rawLineBuffer = logbuffer.NewLineBuffer(1024, n.logRaw)
return n
}