-
Notifications
You must be signed in to change notification settings - Fork 4
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
[SNOW-147] Filter out deleted ACLs from ACL_LATEST
#140
Conversation
No differences between that interactive rebase I did and this new branch, so you're good on that front 👍 |
synapse_data_warehouse/synapse/dynamic_tables/V2.40.0__acl_latest_refactored.sql
Outdated
Show resolved
Hide resolved
…est_refactored.sql Co-authored-by: BryanFauble <17128019+BryanFauble@users.noreply.github.com>
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.
LGTM!
Thanks! I'll be merging this once #142 merges into |
synapse_data_warehouse/synapse/dynamic_tables/V2.40.0__acl_latest_refactored.sql
Outdated
Show resolved
Hide resolved
synapse_data_warehouse/synapse/dynamic_tables/V2.40.0__acl_latest_refactored.sql
Outdated
Show resolved
Hide resolved
synapse_data_warehouse/synapse/dynamic_tables/V2.40.0__acl_latest_refactored.sql
Outdated
Show resolved
Hide resolved
synapse_data_warehouse/synapse/dynamic_tables/V2.40.0__acl_latest_refactored.sql
Outdated
Show resolved
Hide resolved
synapse_data_warehouse/synapse/dynamic_tables/V2.40.0__acl_latest_refactored.sql
Outdated
Show resolved
Hide resolved
I just bumped up to the latest version, would y'all mind giving this one last review before I merge? Thanks! |
synapse_data_warehouse/synapse/dynamic_tables/V2.41.0__acl_latest_refactored.sql
Outdated
Show resolved
Hide resolved
|
problem
aclsnapshots
does not capture deleted ACLs, and there was an issue in the way the latest ACLs were retrieved. Both are addressed in the solution below.solution
ACL_LATEST
dynamic tableACL_LATEST
dynamic table, refactoredsnapshot_date
window to filter out for only the latest ACLs, which should minimize the risk of including deleted ACLsOriginal Process
Original Data Structure
In this example, principal ID 200 gets
READ
privileges removed in 2025.Data Structure (After Unpacking & Deduplicating)
Notice how unpacking before deduplicating, and defining a duplicate as a repeated entry of
owner_id
access_type
andprinicpal_id
, lets the ACL with pid 200 sneak into the final latest table, even though their permissions were removed in 1-1-2025.New Process
Data Structure (After Deduplicating & Unpacking)
When we first deduplicate only based on the
owner_id
, and then unpack theaccess_type
andprincipal_id
, only the ACL from 1-1-2025 is kept in the latest table.testing
For testing, I created a temporary table for `ACL_LATEST` that I ran all the queries against.
Next, I queried for the discrepancies between the temporary table and the current `acl_latest`
Lastly, I would arbitrarily select entities (`owner_id`) from the previous query and compare the ACL results between the new solution table and the current ACL_LATEST table, against the entity itself on Synapse.
Here are some example results that confirm the results from `temp_acl_latest` are more accurate
acl_latest
new sol:

original sol has 3 ACLs that were removed:

Leveraging NODE_LATEST/TEAM_LATEST for further verification
I looked to see what nodes might be missing from the new solution, and found that all the ones listed are nodes that don't exist anymore (a separate problem for
node_latest
).Likeswise, I did the same for teams and saw that MOST of the missing IDs are because they don't exist in the original
aclsnapshots
table OR because of the 14 day cutoff in our new solution (see below for the ones that ARE in aclsnapshots, but don't make it through the 14 day cutoff):