Skip to content

sqlliveness/slstorage: break InternalExecutor depedency#65648

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
ajwerner:ajwerner/break-internal-executor-dep-on-sqlliveness
Jun 10, 2021
Merged

sqlliveness/slstorage: break InternalExecutor depedency#65648
craig[bot] merged 1 commit intocockroachdb:masterfrom
ajwerner:ajwerner/break-internal-executor-dep-on-sqlliveness

Conversation

@ajwerner
Copy link
Copy Markdown
Contributor

There was no fundamental reason to rely on SQL for this low-level subsystem.

Release note: None

@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@ajwerner ajwerner force-pushed the ajwerner/break-internal-executor-dep-on-sqlliveness branch from 9553254 to 7956dbd Compare May 25, 2021 18:26
Copy link
Copy Markdown
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

Change LGTM, but CI is telling you that there are now a couple of dead functions that you should remove.

Reviewed 4 of 4 files at r1, 2 of 2 files at r2.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)


pkg/sql/sqlliveness/slstorage/slstorage_test.go, line 64 at r2 (raw file):

		tDB.Exec(t, schema)
		var tableID descpb.ID
		tDB.QueryRow(t, "SELECT $1::regclass::int",

that regclass cast under the hood recurses into a lot of subsystems. There's a lot of opportunity for things to go wrong.

What about

select u.id 
  from system.namespace t
  join system.namespace u 
    on t.id = u."parentID" 
 where t.name = $1 and u.name = 'sqlliveness'

with dbName as argument


pkg/sql/sqlliveness/slstorage/slstorage_test.go, line 319 at r2 (raw file):

	tDB.Exec(t, schema)
	var tableID descpb.ID
	tDB.QueryRow(t, "SELECT $1::regclass::int",

ditto

@ajwerner ajwerner force-pushed the ajwerner/break-internal-executor-dep-on-sqlliveness branch from 7956dbd to 6628800 Compare June 9, 2021 02:48
@ajwerner ajwerner marked this pull request as ready for review June 9, 2021 02:51
@ajwerner ajwerner requested a review from a team June 9, 2021 02:51
There was no fundamental reason to rely on SQL for this low-level subsystem.

Release note: None
@ajwerner ajwerner force-pushed the ajwerner/break-internal-executor-dep-on-sqlliveness branch from 6628800 to 686f323 Compare June 9, 2021 13:57
Copy link
Copy Markdown
Contributor Author

@ajwerner ajwerner 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 @knz)


pkg/sql/sqlliveness/slstorage/slstorage_test.go, line 64 at r2 (raw file):

Previously, knz (kena) wrote…

that regclass cast under the hood recurses into a lot of subsystems. There's a lot of opportunity for things to go wrong.

What about

select u.id 
  from system.namespace t
  join system.namespace u 
    on t.id = u."parentID" 
 where t.name = $1 and u.name = 'sqlliveness'

with dbName as argument

Done.

Copy link
Copy Markdown
Contributor

@knz knz left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 5 files at r3.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @ajwerner)

@knz
Copy link
Copy Markdown
Contributor

knz commented Jun 10, 2021

will appreciate a backport to 21.1

@ajwerner
Copy link
Copy Markdown
Contributor Author

TFTR!

bors r=knz

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jun 10, 2021

Build succeeded:

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