Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

tbg
Copy link
Member

@tbg tbg commented Sep 20, 2017

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.

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.
@tbg tbg requested a review from a team September 20, 2017 21:39
@cockroach-teamcity
Copy link
Member

This change is Reviewable

//
// 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
Copy link
Member

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
Copy link
Member

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 {
Copy link
Member

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.

Copy link
Contributor

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.
Copy link
Member

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

@tbg
Copy link
Member Author

tbg commented Dec 6, 2017

Obviated by @spencerkimball's improvements.

@tbg tbg closed this Dec 6, 2017
@tbg tbg deleted the kvdebug/gcq-limits branch December 6, 2017 21:07
@tbg tbg restored the kvdebug/gcq-limits branch April 16, 2018 15:25
@tbg tbg deleted the kvdebug/gcq-limits branch May 8, 2018 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants