Skip to content

Conversation

@jiangxinmeng1
Copy link
Contributor

@jiangxinmeng1 jiangxinmeng1 commented Dec 1, 2025

User description

What type of PR is this?

  • API-change
  • BUG
  • Improvement
  • Documentation
  • Feature
  • Test and CI
  • Code Refactoring

Which issue(s) this PR fixes:

issue #22790

What this PR does / why we need it:

update bvt


PR Type

Tests, Bug fix


Description

  • Remove verbose logging from getRowsByPK error handling

  • Add pessimistic transaction snapshot test cases

  • Test HNSW index behavior with experimental flag

  • Test table cloning during ALTER TABLE operations


Diagram Walkthrough

flowchart LR
  A["Logging Cleanup"] --> B["Reduced Log Output"]
  C["New Test Cases"] --> D["Snapshot Tests"]
  D --> E["HNSW Index Flag Check"]
  D --> F["Clone in ALTER TABLE"]
Loading

File Walkthrough

Relevant files
Bug fix
2 files
base_table.go
Remove verbose object ID from error log                                   
+1/-1     
mvccnode.go
Remove verbose logging from error handling                             
+0/-3     
Tests
8 files
restore_skip_experimental_index_flag_check.sql
Add HNSW index experimental flag restore test                       
+38/-0   
restore_skip_experimental_index_flag_check.result
Expected results for experimental flag restore                     
+40/-0   
clone_in_alter_table.sql
Add table clone during ALTER TABLE test                                   
+16/-0   
clone_in_alter_table.result
Expected results for clone in ALTER TABLE                               
+19/-0   
clone_in_alter_table.sql
Add table clone during ALTER TABLE test                                   
+0/-12   
clone_in_alter_table.result
Expected results for clone in ALTER TABLE                               
+0/-15   
restore_skip_experimental_index_flag_check.sql
Add HNSW index experimental flag restore test                       
+0/-40   
restore_skip_experimental_index_flag_check.result
Expected results for experimental flag restore                     
+0/-40   
Additional files
38 files
datalink.result [link]   
datalink.sql [link]   
fulltext.result [link]   
fulltext.sql [link]   
fulltext1.result [link]   
fulltext1.sql [link]   
fulltext2.result [link]   
fulltext2.sql [link]   
fulltext_async.result [link]   
fulltext_async.sql [link]   
fulltext_bm25.result [link]   
fulltext_bm25.sql [link]   
jsonvalue.result [link]   
jsonvalue.sql [link]   
vector.result [link]   
vector.sql [link]   
vector_func.result [link]   
vector_func.sql [link]   
vector_hnsw.result [link]   
vector_hnsw.sql [link]   
vector_hnsw_async.result [link]   
vector_hnsw_async.sql [link]   
vector_hnsw_f64.result [link]   
vector_hnsw_f64.sql [link]   
vector_hnsw_f64_async.result [link]   
vector_hnsw_f64_async.sql [link]   
vector_index.result [link]   
vector_index.sql [link]   
vector_index_edge_cases.result [link]   
vector_index_edge_cases.sql [link]   
vector_ivf.result [link]   
vector_ivf.sql [link]   
vector_ivf_async.result [link]   
vector_ivf_async.sql [link]   
vector_type.result [link]   
vector_type.sql [link]   
clone.result +0/-1301
clone.sql +0/-699 

@qodo-code-review
Copy link

qodo-code-review bot commented Dec 1, 2025

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
🟢
No security concerns identified No security vulnerabilities detected by AI analysis. Human verification advised for critical code.
Ticket Compliance
🎫 No ticket provided
  • Create ticket/issue
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Reduced context: The updated log in getRowsByPK removes object context (obj.ID().String()), which may
hinder diagnosing failures while returning the same error path.

Referred Code
logutil.Infof("getRowsByPK failed GetDuplicate: %v", err)
return

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status:
Error logging: The new logutil.Infof("getRowsByPK failed GetDuplicate: %v", err) logs raw
errors at info level, which might include sensitive details depending on error content.

Referred Code
logutil.Infof("getRowsByPK failed GetDuplicate: %v", err)
return

Learn more about managing compliance generic rules or creating your own custom rules

  • Update
Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@qodo-code-review
Copy link

qodo-code-review bot commented Dec 1, 2025

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
High-level
Re-evaluate the necessity of test removal

The PR removes the extensive clone.sql test file, which covers many CLONE and
SNAPSHOT scenarios. This action might create significant gaps in test coverage
for these critical features, and its necessity should be reviewed.

Examples:

test/distributed/cases/snapshot/clone/clone.sql [1-699]

Solution Walkthrough:

Before:

// test/distributed/cases/snapshot/clone/clone.sql
-- clone db/table in current account with snapshot
create database test01;
...
create snapshot sp01 for account;
create database test01_new clone test01 {snapshot = 'sp01'};
...
-- clone db/table in current account without snapshot
create database test05;
...
create database test05_new clone test05;
...
-- clone db/table to new account with snapshot
create account acc02 ...;
create database test09;
...
create snapshot sp09 for account;
create database test09_new clone test09 {snapshot = 'sp09'} to account acc02;
...
-- Chained cloning tests
...

After:

// test/distributed/cases/snapshot/clone/clone.sql
// (File is deleted)

// New, more specific tests are added, but they don't cover
// the broad range of scenarios from the deleted file.
// e.g., test/distributed/cases/pessimistic_transaction/snapshot/clone_in_alter_table.sql
drop database if exists test;
create database test;
use test;
...
create table t2 (...);
...
alter table t2 add column f int;
select ... from t2;
...
Suggestion importance[1-10]: 9

__

Why: This suggestion correctly identifies the removal of a massive test file (clone.sql) and raises a critical concern about a potential significant gap in test coverage for core CLONE and SNAPSHOT features.

High
General
Use DROP DATABASE IF EXISTS

Use DROP DATABASE IF EXISTS test03 instead of DROP DATABASE test03 to prevent
test failures if the database does not exist after a potentially failed restore
operation.

test/distributed/cases/pessimistic_transaction/snapshot/restore_skip_experimental_index_flag_check.sql [4-17]

 drop database if exists test03;
 create database test03;
 use test03;
 drop table if exists vector_empty;
 CREATE TABLE vector_empty(a bigint primary key, b vecf32(32), KEY `idxname` USING HNSW(b) M = 48 EF_CONSTRUCTION = 64 EF_SEARCH = 64 OP_TYPE "vector_l2_ops");
 DROP TABLE vector_empty;
 drop snapshot if exists snap03;
 create snapshot snap03 for account sys;
 drop database test03;
 restore account sys{snapshot="snap03"};
 show variables like "experimental_hnsw_index";
 set experimental_hnsw_index=0;
-drop database test03;
+drop database if exists test03;
 drop snapshot snap03;
  • Apply / Chat
Suggestion importance[1-10]: 4

__

Why: The suggestion correctly identifies a potential point of failure in the test script and proposes using DROP DATABASE IF EXISTS to make the cleanup step more robust.

Low
  • Update

@matrix-meow matrix-meow added size/XS Denotes a PR that changes [1, 9] lines and removed size/S Denotes a PR that changes [10,99] lines labels Dec 10, 2025
@mergify
Copy link
Contributor

mergify bot commented Dec 11, 2025

Merge Queue Status

✅ The pull request has been merged at 1bd6363

This pull request spent 8 seconds in the queue, with no time running CI.
The checks were run in-place.

Required conditions to merge
  • #approved-reviews-by >= 1 [🛡 GitHub branch protection]
  • #changes-requested-reviews-by = 0 [🛡 GitHub branch protection]
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • branch-protection-review-decision = APPROVED [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-neutral = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
    • check-skipped = Matrixone Standlone CI / Multi-CN e2e BVT Test on Linux/x64(LAUNCH, PROXY)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH, PESSIMISTIC)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / SCA Test on Ubuntu/x86
    • check-neutral = Matrixone CI / SCA Test on Ubuntu/x86
    • check-skipped = Matrixone CI / SCA Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone CI / UT Test on Ubuntu/x86
    • check-neutral = Matrixone CI / UT Test on Ubuntu/x86
    • check-skipped = Matrixone CI / UT Test on Ubuntu/x86
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-neutral = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
    • check-skipped = Matrixone Compose CI / multi cn e2e bvt test docker compose(Optimistic/PUSH)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-neutral = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
    • check-skipped = Matrixone Standlone CI / e2e BVT Test on Linux/x64(LAUNCH,Optimistic)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-neutral = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
    • check-skipped = Matrixone Upgrade CI / Compatibility Test With Target on Linux/x64(LAUNCH)
  • any of [🛡 GitHub branch protection]:
    • check-success = Matrixone Utils CI / Coverage
    • check-neutral = Matrixone Utils CI / Coverage
    • check-skipped = Matrixone Utils CI / Coverage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/test-ci Review effort 2/5 size/XS Denotes a PR that changes [1, 9] lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants