Skip to content

Update PolicyEnforcer to only validate table based segment.#18018

Merged
cryptoe merged 1 commit intoapache:masterfrom
cecemei:policy-followup
May 20, 2025
Merged

Update PolicyEnforcer to only validate table based segment.#18018
cryptoe merged 1 commit intoapache:masterfrom
cecemei:policy-followup

Conversation

@cecemei
Copy link
Copy Markdown
Contributor

@cecemei cecemei commented May 19, 2025

Description

Update PolicyEnforcer to only validate table based segment.


This PR has:

  • been self-reviewed.
  • added documentation for new or modified features or behaviors.
  • a release note entry in the PR description.
  • added Javadocs for most classes and all non-trivial methods. Linked related entities via Javadoc links.
  • added or updated version, license, or notice information in licenses.yaml
  • added comments explaining the "why" and the intent of the code wherever would not be obvious for an unfamiliar reader.
  • added unit tests or modified existing tests to cover new code paths, ensuring the threshold for code coverage is met.
  • added integration tests.
  • been tested in a test Druid cluster.

@github-actions github-actions Bot added Area - Batch Ingestion Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262 labels May 19, 2025
@cecemei
Copy link
Copy Markdown
Contributor Author

cecemei commented May 19, 2025

Was supposed to add this in PR #17960 - I overlooked it.

@cecemei cecemei marked this pull request as ready for review May 20, 2025 00:45
// Validation will always fail on lookups, external, and inline segments, because they will not have policies applied (except for NoopPolicyEnforcer).
// This is a temporary solution since we don't have a perfect way to identify segments that are backed by a regular table yet.
SegmentId segmentId = segment.getId();
// SegmentId is null if the segment is not table based, or is already closed
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just wanted to understand what does segment close mean.

@cryptoe
Copy link
Copy Markdown
Contributor

cryptoe commented May 20, 2025

Please add docs if any are needed to call out this behavior. Something like row policies are not enforced on following datassources:

  • lookups
  • Broadcasted datasources
  • foo
  • bar

@cryptoe cryptoe merged commit d52391e into apache:master May 20, 2025
74 checks passed
@capistrant capistrant added this to the 34.0.0 milestone Jul 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area - Batch Ingestion Area - MSQ For multi stage queries - https://github.com/apache/druid/issues/12262

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants