-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
storage: do not gather up too many intents/keys #18643
Conversation
Fallout from cockroachdb#18199 and corresponding testing in cockroachdb#15997. I think it'll be nontrivial to max out these budgets in practice, but I can definitely do it in intentionally evil tests, and it's good to know that there is some rudimentary form of memory accounting in this queue.
// | ||
// TODO(tschottdorf): we already send multiple GCRequests if we have too many keys, | ||
// but we should be dispatching them as we scan to avoid holding the whole chunk of | ||
// keys in memory. Large Ranges should be the exception, but they can definitely be |
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.
nit: s/Ranges/ranges/
@@ -751,6 +751,13 @@ func RunGC( | |||
txnMap := map[uuid.UUID]*roachpb.Transaction{} | |||
intentSpanMap := map[uuid.UUID][]roachpb.Span{} | |||
|
|||
const ( | |||
intentBudgetBytes = 30 * 1 << 20 // 30mb |
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.
intentBytesBudget
and keyBytesBudget
sound better to me. Take it or leave it.
} | ||
} | ||
} | ||
} | ||
|
||
if intentBytes > intentBudgetBytes { |
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.
Will this... work? We haven't called processKeysAndValues
yet.
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.
Yeah, I think this needs a test.
// extremely likely to be collectable unless the user is running | ||
// very large numbers of very long transactions). But the same | ||
// consideration as the TODO below holds: we should be handling | ||
// the chunk and resetting the budget. |
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.
s/handling the chunks/handling the chunks as we scan
Obviated by @spencerkimball's improvements. |
Fallout from #18199 and corresponding testing in #15997. I think it'll be nontrivial to max out
these budgets in practice, but I can definitely do it in intentionally evil tests, and it's good to
know that there is some rudimentary form of memory accounting in this queue.