Skip to content

colexec: allow unneeded index columns to be skipped in cfetcher#43024

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
rohany:fetcher-needs-too-many
Dec 20, 2019
Merged

colexec: allow unneeded index columns to be skipped in cfetcher#43024
craig[bot] merged 1 commit intocockroachdb:masterfrom
rohany:fetcher-needs-too-many

Conversation

@rohany
Copy link
Copy Markdown
Contributor

@rohany rohany commented Dec 6, 2019

It seems like all indexed columns were being marked as needed in
the cfetcher initialization steps, whether they were actually
in neededCols or not. This meant that unneeded columns weren't
actually getting skipped.

Release note: None

@rohany rohany requested review from a team and jordanlewis December 6, 2019 17:17
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@rohany
Copy link
Copy Markdown
Contributor Author

rohany commented Dec 6, 2019

I'm not sure if this is correct, so running the test suite to see if my hunch is right. I noticed this by wondering why #43002 doesn't fix #42994. In the normal row fetcher all indexed columns are decoded, but the cfetcher has the ability to skip keys.

@rohany
Copy link
Copy Markdown
Contributor Author

rohany commented Dec 7, 2019

This depends on #43002 after the recent push.

Copy link
Copy Markdown
Member

@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

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

This needs some tests that prove that what you say is being added is actually true. Like, make a query that doesn't read all index columns and have some unsupported types in there.

It looks like it's failing CI due to an unsupported type thing?

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis)

// One value per column that is part of the key; each value is a column
// index (into cols); -1 if we don't need the value for that column.
indexColOrdinals []int
// allIndexColOrdinals is the same as allIndexColOrdinals but
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This sentence references the same field twice

indexColOrdinals []int
// allIndexColOrdinals is the same as allIndexColOrdinals but
// does not contain any -1's. It is meant to be used only in logging.
allIndexColOrdinals []int
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It seems like we use it for more than just logging, no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

we use it to just fill in all of the index columns when printing k/vs to the trace, as opposed to the needed set when tracekv is off

@rohany
Copy link
Copy Markdown
Contributor Author

rohany commented Dec 17, 2019

This PR actually depends on #43002 to pass the tests -- there are tests in master already that test what you're asking for, but this PR removed the code that allowed those tests to pass in favor of combining with #43002 to address those issues. I'll let it merge and update the PR.

It seems like all indexed columns were being marked as needed in
the cfetcher initialization steps, whether they were actually
in neededCols or not. This meant that unneeded columns weren't
actually getting skipped.

Release note: None
@rohany rohany force-pushed the fetcher-needs-too-many branch from 469ccb0 to a8bbae1 Compare December 17, 2019 03:52
@rohany
Copy link
Copy Markdown
Contributor Author

rohany commented Dec 17, 2019

RFAL

@rohany rohany requested a review from jordanlewis December 17, 2019 03:53
@yuzefovich
Copy link
Copy Markdown
Member

I think this PR fixes #43153, right?

@rohany
Copy link
Copy Markdown
Contributor Author

rohany commented Dec 17, 2019

I think so? I don't know how to find the schema of the tables in the queries to try it out though...

@yuzefovich
Copy link
Copy Markdown
Member

You need to go to Artifacts tab of the build that failed. In there, you can find sqlsmith.log that contains all the queries that were executed before hitting the error / panic. For example, https://teamcity.cockroachdb.com/viewLog.html?buildId=1643186&buildTypeId=Cockroach_Nightlies_WorkloadNightly&tab=artifacts#%2Fsqlsmith%2Fsetup%3Dempty%2Fsetting%3Ddefault. Also, looking at the logs of the nodes can be helpful to see the stack trace (e.g. https://teamcity.cockroachdb.com/repository/download/Cockroach_Nightlies_WorkloadNightly/1643186:id/sqlsmith/setup%3Dempty/setting%3Ddefault/1.logs/cockroach.log).

@rohany
Copy link
Copy Markdown
Contributor Author

rohany commented Dec 17, 2019

Yes i see that, but it doesn't show me the initial set of defined tables available to SQLsmith -- the logs just start with the queries it is running. @mjibson where should I look?

@yuzefovich
Copy link
Copy Markdown
Member

The config is called "empty", so there are no initial tables in that case. If there were, they would also be included in the sqlsmith.log.

@rohany
Copy link
Copy Markdown
Contributor Author

rohany commented Dec 20, 2019

Alright, I've confirmed that #43395 is fixed by this commit.

Copy link
Copy Markdown
Member

@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis)

@rohany
Copy link
Copy Markdown
Contributor Author

rohany commented Dec 20, 2019

bors r+

craig bot pushed a commit that referenced this pull request Dec 20, 2019
43024: colexec: allow unneeded index columns to be skipped in cfetcher r=rohany a=rohany

It seems like all indexed columns were being marked as needed in
the cfetcher initialization steps, whether they were actually
in neededCols or not. This meant that unneeded columns weren't
actually getting skipped.

Release note: None

Co-authored-by: Rohan Yadav <rohany@alumni.cmu.edu>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Dec 20, 2019

Build succeeded

@yuzefovich
Copy link
Copy Markdown
Member

We should backport this commit and unrevert the revert (#43072), right guys? cc @asubiotto

@rohany
Copy link
Copy Markdown
Contributor Author

rohany commented Dec 30, 2019

This has to be backported too #43002 (and first) I think

@asubiotto
Copy link
Copy Markdown
Contributor

OK. So to summarize we need to backport #43002, #43024 and then unrevert #43072 in that order?

@rohany
Copy link
Copy Markdown
Contributor Author

rohany commented Jan 13, 2020

Yes, i think that is correct.

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.

5 participants