Skip to content

colfetcher: use IndexFetchSpec#75767

Merged
craig[bot] merged 2 commits intocockroachdb:masterfrom
RaduBerinde:index-fetch-spec-cfetcher
Feb 2, 2022
Merged

colfetcher: use IndexFetchSpec#75767
craig[bot] merged 2 commits intocockroachdb:masterfrom
RaduBerinde:index-fetch-spec-cfetcher

Conversation

@RaduBerinde
Copy link
Copy Markdown
Member

row: refactor error handling code

This change refactors the row.Fetcher error handling code to no
longer rely on the table descriptor. The interesting part is where we
decode key values for a locking error; we now use the IndexFetchSpec
and decode the key directly rather than setting up a fake fetcher
through DecodeRowInfo.

Release note: None

colfetcher: use IndexFetchSpec

This commit converts the cFetcher to use an IndexFetchSpec instead of
table and index descriptors.

Release note: None

@RaduBerinde RaduBerinde requested review from a team and yuzefovich February 1, 2022 01:32
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@yuzefovich yuzefovich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 4 of 4 files at r1, 9 of 9 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @RaduBerinde)


pkg/sql/colfetcher/cfetcher.go, line 1140 at r2 (raw file):

// processValueSingle processes the given value (of column
// family.DefaultColumnID), setting values in cf.machine.colvecs accordingly.

nit: family.DefaultColumnID is no more.


pkg/sql/colfetcher/cfetcher_setup.go, line 36 at r2 (raw file):

	spec descpb.IndexFetchSpec
	// ColIdxMap is a mapping from ColumnID to the ordinal of the corresponding
	// column within the cols field.

nit: something like s/cols/spec.FetchedColumns/.


pkg/sql/colfetcher/cfetcher_setup.go, line 38 at r2 (raw file):

	// column within the cols field.
	ColIdxMap catalog.TableColMap
	// typs are the types of spec.FetchColumns.

nit: I think FetchedColumns.


pkg/sql/colfetcher/cfetcher_setup.go, line 172 at r2 (raw file):

	}

	// Remapt he post processing spec. away columns that aren't needed.

nit: s/Remapt he/Remap the/, then there is something off in "spec. away".


pkg/sql/row/errors.go, line 225 at r1 (raw file):

	allColumns bool,
) (_ catalog.Index, columnNames []string, columnValues []string, _ error) {
	// Strip the tenant prefix and pretend to use the system tenant's SQL codec

nit: the comment needs an update.

This change refactors the `row.Fetcher` error handling code to no
longer rely on the table descriptor. The interesting part is where we
decode key values for a locking error; we now use the `IndexFetchSpec`
and decode the key directly rather than setting up a fake fetcher
through `DecodeRowInfo`.

Release note: None
This commit converts the cFetcher to use an IndexFetchSpec instead of
table and index descriptors.

Release note: None
@RaduBerinde RaduBerinde force-pushed the index-fetch-spec-cfetcher branch from 21b0e95 to 1d2f1df Compare February 1, 2022 19:00
Copy link
Copy Markdown
Member Author

@RaduBerinde RaduBerinde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TFTR!

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @yuzefovich)

@RaduBerinde
Copy link
Copy Markdown
Member Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 1, 2022

This PR was included in a batch that was canceled, it will be automatically retried

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 1, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 2, 2022

Build succeeded:

@craig craig bot merged commit 9f4ce34 into cockroachdb:master Feb 2, 2022
@RaduBerinde RaduBerinde deleted the index-fetch-spec-cfetcher branch February 2, 2022 17:16
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.

3 participants