Skip to content

Improve error messages for unsupported __audit database operations#18293

Open
CRZbulabula wants to merge 1 commit into
apache:masterfrom
CRZbulabula:yongzao/improve-audit-database-error-message
Open

Improve error messages for unsupported __audit database operations#18293
CRZbulabula wants to merge 1 commit into
apache:masterfrom
CRZbulabula:yongzao/improve-audit-database-error-message

Conversation

@CRZbulabula

Copy link
Copy Markdown
Contributor

Description

Error message

Replace the misleading read-only error used for unsupported operations on the audit database with a more accurate message:

Apache IoTDB does not support this operation on database '%s'.

The message is shared by the tree-model and table-model authorization paths and is localized in both English and Chinese.

Affected operations

  • Apply the new message to tree-model write, schema, template, TTL, and database deletion checks that previously reported the audit database as read-only.
  • Apply the same message to unsupported table-model operations on __audit.
  • Keep the existing reserved-name, grant/revoke, and AUDIT-admin query messages unchanged because they already describe their restrictions precisely.

Test coverage

  • Add coverage for DELETE DATABASE root.__audit and template operations in IoTDBTemplateAuthIT.
  • Update TTL coverage in IoTDBSeriesPermissionIT.
  • Add coverage for DROP DATABASE __audit in IoTDBAuthenticationTableIT.

Verified with:

  • Full-reactor English and Chinese test compilation.
  • IoTDBTemplateAuthIT#manageDataBaseTest.
  • IoTDBSeriesPermissionIT#ttlOperationsTest.
  • IoTDBAuthenticationTableIT#testInsert with the table-simple profile.

This PR has:

  • been self-reviewed.
  • added comments explaining the intent where it was not obvious.
  • added or updated integration tests.
  • been tested in a test IoTDB cluster.

Key changed/added classes (or packages if there are too many classes) in this PR
  • AccessControlImpl
  • ITableAuthCheckerImpl
  • TreeAccessCheckVisitor
  • DataNodeQueryMessages

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.

1 participant