Skip to content
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

sql: add pg_catalog.pg_isolation_test_session_is_blocked builtin #116708

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

nvanbenschoten
Copy link
Member

@nvanbenschoten nvanbenschoten commented Dec 18, 2023

Informs #95771.

This commit adds the pg_catalog.pg_isolation_test_session_is_blocked builtin, which supports Postgres' isolationtester.

The function checks if the specified PID is blocked by any of the PIDs listed in the second argument. Currently, this only looks for blocking caused by waiting for locks.

This is an undocumented function intended for use by the isolation tester. It is not intended for use by end users.

While here, fix the signature of pg_catalog.pg_blocking_pids and leave a TODO to implement the builtin using crdb_internal.cluster_locks.

Release note: None

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Informs cockroachdb#95771.

This commit adds the pg_catalog.pg_isolation_test_session_is_blocked
builtin, which supports Postgres' isolationtester.

The function checks if the specified PID is blocked by any of the PIDs
listed in the second argument. Currently, this only looks for blocking
caused by waiting for locks.

This is an undocumented function intended for use by the isolation
tester. It is not intended for use by end users.

While here, fix the signature of pg_blocking_pids and leave a TODO to
implement the builtin using `crdb_internal.cluster_locks`.

Release note: None
Copy link

blathers-crl bot commented Jan 8, 2024

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@nvanbenschoten nvanbenschoten marked this pull request as ready for review February 5, 2024 18:31
@nvanbenschoten nvanbenschoten requested a review from a team as a code owner February 5, 2024 18:31
Copy link
Collaborator

@rafiss rafiss left a comment

Choose a reason for hiding this comment

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

lgtm! just had very minor nits

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


-- commits line 19 at r1:
is pg_blocking_pids also internal? if not, then maybe the signature change should be in a release note


pkg/sql/sem/builtins/pg_builtins.go line 2027 at r1 (raw file):

	// tester, and may change in future releases as required for testing
	// purposes.
	"pg_isolation_test_session_is_blocked": makeBuiltin(defProps(),

instead of defProps(), we could use one with Undocumented: true:

tree.FunctionProperties{  
  Category:     builtinconstants.CategorySystemInfo,  // or maybe CategoryCompatibility
  Undocumented: true,  
}

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.

None yet

3 participants