Files
greptimedb/tests/cases
dennis zhuangandLei, HUANG 57205c6792 fix(mito): return from manual index builds only after the index is published [Backport release/v1.3] (#9872)
* fix(mito): avoid pinning region version when rebuilding indexes (#9597)

refactor(mito): avoid pinning region version when rebuilding indexes

handle_rebuild_index kept the whole region version alive across the
manifest read and schedule_build awaits, which pins memtables and the
SST version even though index build tasks only need the region metadata,
index options and the candidate SST file handles.

Extract those inputs into a small IndexBuildSnapshot and drop the version
before awaiting.

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
(cherry picked from commit 9089ea7a4b)
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(mito): return from manual index builds only after the index is published (#9643)

* fix(mito): return from manual index builds only after the index is published

A manual build_index could report success while the index was missing:
the request was rejected or coalesced behind another build, the manifest
commit failed, the indexer dropped an error, or the region was staging.
Manual builds now wait for active builds of the same SST, keep their
waiters across coalescing and schema-change retries, are notified after
the worker applies the edit, and verify the files against the manifest
before returning.

The consistency check also honors inverted_index.ignore_column_ids and a
zero segment row count, so such SSTs are no longer rebuilt on every call.

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* test(mito): cover manual index build waiting for a schema-change retry

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(mito): select manual index build files by the applied version

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* chore(mito): log why index builds are skipped or aborted

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* refactor(mito): split IndexBuildTask::index_build into phases

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(mito): stop scheduling index builds when the region state changes

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* chore(mito): document region file id and silent aborts in index builds

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(mito): log why a manual index build is incomplete

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* fix(mito): expose incomplete index builds and treat compacted files as done

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

* test(mito): pin index build concurrency in the compaction test

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

---------

Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
(cherry picked from commit 436d07bf2d)
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>

---------

Signed-off-by: Lei, HUANG <ratuthomm@gmail.com>
Signed-off-by: Dennis Zhuang <killme2008@gmail.com>
Co-authored-by: Lei, HUANG <6406592+v0y4g3r@users.noreply.github.com>
2026-10-22 17:22:43 +08:00
..