-
Notifications
You must be signed in to change notification settings - Fork 90
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
Use TACL cluster in test_all_grant_types
and wait for ANONYMOUS FILE
grant
#3800
base: main
Are you sure you want to change the base?
Conversation
❌ 107/112 passed, 5 failed, 8 skipped, 8h31m22s total ❌ test_all_grant_types: TimeoutError: Timed out after 0:03:00 (20m12.287s)
❌ test_all_grants_for_other_objects: AssertionError: assert {'MODIFY', 'SELECT'} == set() (11m31.159s)
❌ test_grant_findings: AttributeError: 'list' object has no attribute 'object_type' (24m26.62s)
❌ test_table_migration_job_refreshes_migration_status[regular-migrate-tables]: databricks.sdk.errors.platform.BadRequest: org.apache.hadoop.hive.ql.metadata.HiveException: MetaException(message:javax.jdo.JDODataStoreException: Exception thrown flushing changes to datastore (11m18.892s)
❌ test_permission_for_files_anonymous_func_migration_api: TimeoutError: Timed out after 0:02:00 (11m27.256s)
Running from acceptance #8469 |
cfaceb2
to
a7c762e
Compare
a7c762e
to
e405ef6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pritishpai : Handing over this PR to you. We looked into the issue yesterday and saw it might be an issue specific to our workspace.
I added some comments with my thoughts.
assert tables_crawler._catalog == udf._catalog | ||
assert tables_crawler._schema == udf._schema | ||
super().__init__(tables_crawler._sql_backend, tables_crawler._catalog, tables_crawler._schema, "grants", Grant) | ||
def __init__( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decoupled the grantscrawler from the tables crawler for two reasons:
- IMO it is confusing because AFAIK this is the only crawler which does it. It also bears the question: why not tightly couple it with the UDFs crawler?
- The
GrantsCrawler
is expected to run against a differentSqlBackend
in the assessment workflow, namely the TACL cluster.
@@ -25,7 +35,7 @@ def _deployed_schema(runtime_ctx) -> None: | |||
|
|||
|
|||
@retried(on=[NotFound, TimeoutError], timeout=dt.timedelta(minutes=3)) | |||
def test_all_grant_types(runtime_ctx: MockRuntimeContext, _deployed_schema: None): | |||
def test_all_grant_types(runtime_ctx: MockRuntimeContext, sql_backend_tacl: SqlBackend, _deployed_schema: None): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am mimicking the assessment workflow here:
TablesCrawler
andUdfsCrawler
run against the "regular" backendGrantsCrawler
run against the "tacl" backend
wait_for_grants(contains_select_on_any_file, any_file=True) | ||
# Only verifying the SELECT permission on ANY FILE and ANONYMOUS FUNCTION as those take a while to propagate. | ||
wait_for_grants(grants_contain_select_action, any_file=True) | ||
wait_for_grants(grants_contain_select_action, anonymous_function=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fails with the following error:
DatabricksServiceHttpClientException: TEMPORARILY_UNAVAILABLE: The service at /api/2.0/sql-acl/get-permissions is taking too long to process your request. Please try again later or try a faster operation. [TraceId: 00-afa5633f98d2b7cbc47937e9233436b5-c5249ad122b4daa2-00]
This endpoint API docs suggest to use the new API endpoint. However, the choice for API endpoint is not up to us as it we use SHOW GRANTS ...
- not the API endpoints directly. (Note we might implicitly chose the endpoint with the runtime.)
@gueniai : Could you ask the endpoint team on guidance here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried manually last night and I could make the /api/2.0/sql-acl/get-permissions
via a python api call. If the endpoint team can give us the revoke permissions or anything that can help us clear the dangling permissions it would help us a lot.
e405ef6
to
9e44daa
Compare
Changes
Use TACL cluster in
test_all_grant_types
and wait forANONYMOUS FILE
grant to improve stability of test.Linked issues
Resolves #3798
Related to #3765
Tests
test_all_grant_types
&test_grant_findings