Repository navigation
SOLR-18682: Continue the caller's trace in Overseer Collection API commands - #5405
sarkaramrit1993 wants to merge 1 commit into
Conversation
|
Automated PR readiness judgements (LLM-generated; may be wrong; not updated on later pushes).
|
| } | ||
| }; | ||
|
|
||
| /** Adds the current trace context to a Collection API message for the Overseer. */ |
There was a problem hiding this comment.
other than this javadoc, this method doesn't evoke "Overseer"-ness. The following methods you add don't even do that. Maybe it should just be where the caller is instead of trying to have TraceUtils cross-cut everything.
CC @stillalex as I believe you did it this way intentionally.
| } | ||
|
|
||
| /** Returns the message without the keys added by {@link #injectTraceContext(Map)}. */ | ||
| public static ZkNodeProps removeTraceContext(ZkNodeProps message) { |
There was a problem hiding this comment.
is it really so bad to leave the trace context there?
| String name, String collection, boolean isAsync) { | ||
| String name, String collection, boolean isAsync, Context parent) { | ||
| Tracer tracer = getGlobalTracer(); | ||
| SpanKind kind = isAsync ? SpanKind.PRODUCER : SpanKind.CLIENT; |
There was a problem hiding this comment.
I suppose SpanKind.CLIENT would only make sense for Overseer processing, but not for disabled Overseer
| "http.url":"http://NORMALIZED/solr/admin/cores", | ||
| "http.params":"action=RELOAD"}]}, | ||
| { | ||
| "spans":[{ |
There was a problem hiding this comment.
hmm; the indentation style is different, which isn't good for diff'ing
Description
SOLR-18682: with the Overseer, a traced Collection API request and its command land in unrelated traces, because the ZK queue message carries no trace context. Distributed mode already links them.
Solution
_trace.*keys.TraceAwareCommandparents the command span on it and strips the keys before the command runs.ModifyCollectionCmdwaits for them in state, routedCreateAliasCmdwrites them toaliases.json.Out of scope: traces for those two commands, Config Set API messages, and checking MIGRATE, REINDEXCOLLECTION, DELETESHARD, RENAME and RESTORE against an older Overseer.
Tests
TestDistributedTracing: one trace for create and delete (fails on main), no span for an unsampled caller, a routed alias stores no trace context.testV2Api.jsononly re-nests the core reload spans.TraceAwareCommandTest: the command never sees_trace.*keys.