Skip to content

refactor(query): Gracefully handle unknown GrantEntry objects in UserGrantSet::from_pb #18400

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

TCeason
Copy link
Collaborator

@TCeason TCeason commented Jul 22, 2025

I hereby agree to the terms of the CLA available at: https://docs.databend.com/dev/policies/cla/

Summary

When an older version of the application processes UserGrantSet data that contains GrantEntry objects with newly introduced GrantObject types, the GrantEntry::from_pb conversion can fail for those specific entries.

This commit modifies the UserGrantSet::from_pb function to gracefully handle such scenarios. If GrantEntry::from_pb returns an error (e.g., due to an unknown GrantObject), the error is now logged, and the problematic grant entry is skipped instead of causing the entire conversion to fail.

This ensures that users on older versions can still log in and use their available grants, providing better forward compatibility and robustness against evolving data schemas.
Without this, a user attempting to log in with data containing new GrantObject types would be prevented from logging in on an older client.

Tests

  • Unit Test
  • Logic Test
  • Benchmark Test
  • No Test : keep ci passed

Type of change

  • Bug Fix (non-breaking change which fixes an issue)
  • New Feature (non-breaking change which adds functionality)
  • Breaking Change (fix or feature that could cause existing functionality not to work as expected)
  • Documentation Update
  • Refactoring
  • Performance Improvement
  • Other (please describe):

This change is Reviewable

@github-actions github-actions bot added the pr-refactor this PR changes the code base without new features or bugfix label Jul 22, 2025
TCeason added a commit to TCeason/datafuse that referenced this pull request Jul 22, 2025
Copy link
Contributor

github-actions bot commented Jul 22, 2025

🤖 Smart Auto-retry Analysis

Workflow: 16438178663

📊 Summary

  • Total Jobs: 81
  • Failed Jobs: 1
  • Retryable: 0
  • Code Issues: 1

NO RETRY NEEDED

All failures appear to be code/test issues requiring manual fixes.

🔍 Job Details

  • linux / test_logs: Not retryable (Code/Test)

🤖 About

Automated analysis using job annotations to distinguish infrastructure issues (auto-retried) from code/test issues (manual fixes needed).

TCeason added a commit to TCeason/datafuse that referenced this pull request Jul 22, 2025
TCeason added 2 commits July 22, 2025 15:47
…Set::from_pb

When an older version of the application processes `UserGrantSet` data that
contains `GrantEntry` objects with newly introduced `GrantObject` types, the
`GrantEntry::from_pb` conversion can fail for those specific entries.

This commit modifies the `UserGrantSet::from_pb` function to gracefully
handle such scenarios. If `GrantEntry::from_pb` returns an error (e.g.,
due to an unknown `GrantObject`), the error is now logged, and the
problematic grant entry is skipped instead of causing the entire
conversion to fail.

This ensures that users on older versions can still log in and use
their available grants, providing better forward compatibility and
robustness against evolving data schemas.
Without this, a user attempting to log in with data containing new
`GrantObject` types would be prevented from logging in on an older client.
@TCeason TCeason force-pushed the user_grant_object_incompatible branch from 148a64d to e7d4d4b Compare July 22, 2025 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-refactor this PR changes the code base without new features or bugfix
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants