Skip to content

fix: add check for invalid encode/compress algorithm - 3.3.6#35315

Merged
guanshengliang merged 1 commit into
3.3.6from
fix/check-col-comp-alg-336
May 13, 2026
Merged

fix: add check for invalid encode/compress algorithm - 3.3.6#35315
guanshengliang merged 1 commit into
3.3.6from
fix/check-col-comp-alg-336

Conversation

@localvar
Copy link
Copy Markdown
Contributor

Description

Add server-side validation of column encode/compress/level algorithms at all entry points in mnode and vnode to prevent unsupported compression configurations from being persisted.

Changes:

  • mnode (mndStb.c): Add validColCmprByType() checks in mndBuildStbFromReq(), mndBuildStbFromAlter(), and mndAddSuperTableColumn() for CREATE/ALTER STABLE operations
  • vnode (metaTable2.c): Add validation in metaCreateNormalTable(), metaAddTableColumn(), and metaUpdateTableColCompress2() for normal table operations
  • tests (stb.cpp): Add test cases for invalid encode, compress algorithm, and compress level rejection during CREATE STABLE, ALTER STABLE ADD COLUMN WITH COMPRESS, and ALTER STABLE MODIFY COLUMN COMPRESS

Issue(s)

Checklist

Please check the items in the checklist if applicable.

  • Is the user manual updated?
  • Are the test cases passed and automated?
  • Is there no significant decrease in test coverage?

Copilot AI review requested due to automatic review settings May 11, 2026 09:00
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces validation for column compression algorithms during table creation and alteration in both the mnode and vnode components. It ensures that the specified compression settings are compatible with the column's data type. Additionally, the test suite has been expanded to cover invalid compression configurations. Feedback was provided regarding an inconsistency in mndBuildStbFromReq where default compression was not being applied when no compression was specified, unlike in mndBuildStbFromAlter.

Comment thread source/dnode/mnode/impl/src/mndStb.c
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds server-side validation to reject unsupported column encode/compress/level configurations during CREATE/ALTER operations, ensuring invalid compression settings cannot be persisted in mnode/vnode metadata.

Changes:

  • Add validColCmprByType() checks during STABLE create/alter flows in mnode.
  • Add compression validation for normal table create/add-column/modify-compress flows in vnode meta.
  • Extend mnode STABLE tests to cover invalid encode/compress algorithm and invalid level rejection across create/alter entry points.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
source/dnode/vnode/src/meta/metaTable2.c Validates column compression algorithms for normal table creation and column compression updates.
source/dnode/mnode/impl/src/mndStb.c Adds compression validation when building STABLE metadata from create/alter requests.
source/dnode/mnode/impl/test/stb/stb.cpp Adds unit tests for invalid compress settings in CREATE/ALTER STABLE scenarios.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread source/dnode/vnode/src/meta/metaTable2.c Outdated
Comment thread source/dnode/vnode/src/meta/metaTable2.c
@localvar localvar force-pushed the fix/check-col-comp-alg-336 branch from 4c10d36 to e1f5fae Compare May 12, 2026 02:01
@guanshengliang guanshengliang merged commit cd5b33a into 3.3.6 May 13, 2026
12 checks passed
@guanshengliang guanshengliang deleted the fix/check-col-comp-alg-336 branch May 13, 2026 11:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants