fix(posting): make rollup failures diagnosable in logs - #9808
Merged
Conversation
Two problems make a failing rollup nearly impossible to triage from logs, both surfaced by #9794. The format arguments in incrRollupi.Process are reversed, so the message reads "Error rolling up key [<the error>]: <the key>". The key also printed as a decimal byte slice rather than hex, which can't be fed to `dgraph debug --lookup`. More importantly, the error returned when pIterator.seek fails formats List.Print() into the message. Print() dumps the entire posting list and mutation map, posting values included. On a multi-part list holding large values that's a multi-megabyte log line, and since ReadPostingList re-queues a key for rollup whenever deltas remain, the same line repeats every few seconds for as long as the key stays broken. The actual cause is appended after the dump by errors.Wrapf, so it's the first thing to get truncated, which is exactly what happened in #9794. Add List.debugString(), which reports the key, minTs, maxTs, splits, and mutation-layer counts without any values, and use it on the three seek error paths. Print() stays for interactive debugging. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
shiva-istari
approved these changes
Aug 6, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Two problems make a failing rollup nearly impossible to triage from logs. Both
turned up while looking at #9794, where the reporter's log line was truncated
right before the useful part.
1. Reversed format arguments in
incrRollupi.Processerrandkeyare swapped, so the message readsError rolling up key [<the error>]: <the key>. The key also rendered as a decimal byte slice, which can'tbe pasted into
dgraph debug --lookup. Now%xwith the arguments in the rightorder.
2. The
pIterator.seekerror message dumps the whole posting listList.iterateformattedl.Print()into its error, andPrint()dumps theentire posting list plus mutation map with posting values included. On a
multi-part list holding large values that's a multi-megabyte log line. Since
ReadPostingListre-queues a key for rollup on every read while deltas remain,and
doRollupretries a given key roughly every 10 seconds, the same giant linerepeats for as long as the key stays broken.
Worse for triage:
errors.Wrapfappends the cause after the format string, sothe actual error is the first thing to get cut off.
seekhas only two failuremodes and they have completely different root causes, so losing that suffix
loses the diagnosis:
This PR adds
List.debugString(), which reports the key (hex),minTs,maxTs, splits, and mutation-layer counts, with no posting values, and uses iton the three
seekerror paths initerateandfindPostingWithItr. The twopaths in
findPostingWithItrwere formattingmutationMap.print(), which hasthe same unbounded-value problem.
Print()is unchanged and stays available for interactive debugging.Sample of the new output shape:
Logging only. No behavior change.
Refs #9794.
Checklist
Conventional Commits syntax, leading
with
fix:,feat:,chore:,ci:, etc.🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.