-
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
distsql: add NewFinalIterator to the rowIterator interface #26441
Conversation
Might be worth adding a boolean to the implementors that track whether a final iterator was created, which errors out on any further iteration creations, just to eagerly ensure callers of final iterator are not messing up. this proactive checking would avoid a problem where we actually make destructive final iterator implementations in the future, and only then discover the bugs lurking underneath. Review status: all files reviewed at latest revision, all discussions resolved, some commit checks pending. Comments from Reviewable |
@arjunravinarayan I'm not sure whether we should do that because it is technically valid to call bors r+ |
Review status: all files reviewed at latest revision, all discussions resolved, some commit checks pending. pkg/sql/distsqlrun/row_container.go, line 38 at r1 (raw file):
I find this phrasing a little confusing - I would probably say something like "NewFinalIterator returns a rowIterator that can be used to iterate over the rows, possibly freeing resources along the way. Once you call NewFinalIterator, subsequent calls to NewIterator or NewFinalIterator are not guaranteed to return any rows." Comments from Reviewable |
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks pending. Comments from Reviewable |
bors r- |
Canceled |
Some implementations of the rowIterator interface would destroy rows as they were iterated over to free memory eagerly. NewFinalIterator is introduced in this change to provide non-reusable behavior and NewIterator is explicitly described as reusable. A reusable iterator has been added to the memRowContainer to satisfy these new interface semantics. Release note: None
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks failed. pkg/sql/distsqlrun/row_container.go, line 38 at r1 (raw file): Previously, jordanlewis (Jordan Lewis) wrote…
Done. Comments from Reviewable |
bors r+ |
26441: distsql: add NewFinalIterator to the rowIterator interface r=asubiotto a=asubiotto Some implementations of the rowIterator interface would destroy rows as they were iterated over to free memory eagerly. NewFinalIterator is introduced in this change to provide non-reusable behavior and NewIterator is explicitly described as reusable. A reusable iterator has been added to the memRowContainer to satisfy these new interface semantics. Release note: None 26463: storage: Disable campaign-on-wake when receiving raft messages r=bdarnell a=bdarnell When the incoming message is a MsgVote (which is likely the case for the first message received by a quiesced follower), immediate campaigning will cause the election to fail. This is similar to reverting commit 44e3977, but only disables campaigning in one location. Fixes #26391 Release note: None 26469: lint: Fix a file descriptor leak r=bdarnell a=bdarnell This leak is enough to cause `make lintshort` fail when run under the default file descriptor limit on macos (256). Release note: None 26470: build: Pin go.uuid to the version currently in use r=bdarnell a=bdarnell Updates #26332 Release note: None Co-authored-by: Alfonso Subiotto Marqués <[email protected]> Co-authored-by: Ben Darnell <[email protected]>
Build succeeded |
Some implementations of the rowIterator interface would destroy rows as
they were iterated over to free memory eagerly. NewFinalIterator is
introduced in this change to provide non-reusable behavior and
NewIterator is explicitly described as reusable.
A reusable iterator has been added to the memRowContainer to satisfy
these new interface semantics.
Release note: None