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
rangedesc: add lazy iterator #116520
rangedesc: add lazy iterator #116520
Conversation
45d8df1
to
50a68d6
Compare
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.
Reviewed 4 of 4 files at r1, 2 of 2 files at r2, 3 of 3 files at r3, 1 of 1 files at r4, 2 of 2 files at r5, 1 of 1 files at r6, 2 of 2 files at r7, 2 of 2 files at r8, 1 of 1 files at r9, 4 of 4 files at r10, 1 of 1 files at r11, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @andrewbaptist, @dt, and @msbutler)
pkg/server/node.go
line 2574 at r6 (raw file):
const pageSize = 100 iter, err := n.execCfg.RangeDescIteratorFactory.NewLazyIterator(stream.Context(), args.Span, 100)
nit: s/100/pageSize/g
pkg/util/rangedesc/rangedesc.go
line 86 at r11 (raw file):
// constructor fetches the entirety of the result set and the returned iter is // merely iterating over that buffered result set, so this is actually better // treated as if it is a batch API, eg GetAllRangeDescs(span). Callers should
After this comment was initially written, we spoke on Slack about NewLazyIterator
giving an inconsistent view of range descriptors to callers, unlike NewIterator
, which provides a consistent view. Some callers (notably the observability related ones) need a consistent view.
Consider softening the language in this comment to dissuade users from using this function entirely; instead, maybe let's add some words about the consistent/inconsistent nature of both these methods, and let callers decide what's appropriate for them.
Release note: none. Epic: none.
Release note: none. Epic: none.
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @andrewbaptist, @arulajmani, and @msbutler)
pkg/server/node.go
line 2574 at r6 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
nit: s/100/pageSize/g
I think this is a stale revision since I switched this to pageSize back on dec 15 (oh reviewable).
pkg/util/rangedesc/rangedesc.go
line 86 at r11 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
After this comment was initially written, we spoke on Slack about
NewLazyIterator
giving an inconsistent view of range descriptors to callers, unlikeNewIterator
, which provides a consistent view. Some callers (notably the observability related ones) need a consistent view.Consider softening the language in this comment to dissuade users from using this function entirely; instead, maybe let's add some words about the consistent/inconsistent nature of both these methods, and let callers decide what's appropriate for them.
Softened it up a bit. I might just go add an asOf
timestamp to the lazy iterator constructor and make it scan batches at a fixed timestamp so we can just retire the eager iterator instead, but I've softer the language for now until I do that.
Release note: none. Epic: none.
Release note: none. Epic: none.
Release note (enterprise change): BACKUPs now load range information as they need it to avoid a spike in metadata lookups when backups begin. Epic: none.
TFTR! bors r+ |
Build succeeded: |
see commits.