Skip to content

[Bug]: ivfflat temporary-unprotect bug #23918

@XuPeng-SH

Description

@XuPeng-SH

Is there an existing issue for the same bug?

  • I have checked the existing issues.

Branch Name

3.0-dev, main

Commit ID

latest

Other Environment Information

- Hardware parameters:
- OS type:
- Others:

Actual Behavior

In the ivfflat optimization path the code used delete(builder.protectedScans, id) then later builder.protectedScans[id]++
to restore. This corrupts the count if the original count > 1 and is not panic-safe, potentially leaving protectedScans in an
inconsistent state and causing the planner to pick wrong index paths.

Expected Behavior

temporary unprotect must record the original count and restore it exactly on all exit paths (including panic).

Steps to Reproduce

run ivfflat filter/sort pushdown tests or simulate a panic during optimization and assert protectedScans is unchanged
  after exit.

Additional information

No response

Metadata

Metadata

Assignees

Labels

kind/bugSomething isn't workingseverity/s0Extreme impact: Cause the application to break down and seriously affect the use

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions