Thanks to visit codestin.com
Credit goes to github.com

Skip to content

fix(reindex): skip metadata-only directories without reindexable resource files#2867

Open
bhnan wants to merge 1 commit into
volcengine:mainfrom
bhnan:fix/reindex-metadata-only-directories
Open

fix(reindex): skip metadata-only directories without reindexable resource files#2867
bhnan wants to merge 1 commit into
volcengine:mainfrom
bhnan:fix/reindex-metadata-only-directories

Conversation

@bhnan

@bhnan bhnan commented Jun 26, 2026

Copy link
Copy Markdown

Summary

Fixes #1706

When a directory contains only metadata files (.abstract / .overview) and no actual resource files, the reindex executor incorrectly attempts to process it, leading to errors or empty reindex operations.

Root Cause

_reindex_resource_vectors_from_entries in reindex_executor.py did not check whether a directory has any reindexable resource files before processing it. It would read the abstract/overview and proceed even when no real resource content existed.

Fix

  • Added _directory_has_reindexable_resource_files() helper that checks whether a directory entry list contains any non-metadata resource files
  • In _reindex_resource_vectors_from_entries, skip directories that have no reindexable resource files (metadata-only directories)

Tests

Added comprehensive tests in test_admin_rebuild_api.py covering:

  • Pure metadata-only directory (should be skipped)
  • Directory with mixed metadata + resource files (should be processed)
  • Directory with only resource files (should be processed)

All tests passed: pytest tests/server/test_admin_rebuild_api.py (exit 0)

Files Changed

File Changes
openviking/service/reindex_executor.py +32 lines
tests/server/test_admin_rebuild_api.py +144 lines

…urce files

Problem (Issue volcengine#1706):
When a directory contains only metadata files (.abstract / .overview) and
no actual resource files, the reindex executor incorrectly attempts to
process it, leading to errors or empty reindex operations.

Root cause:
_reindex_resource_vectors_from_entries in reindex_executor.py did not
check whether a directory has any reindexable resource files before
processing it. It would read the abstract/overview and proceed even when
no real resource content existed.

Fix:
- Added _directory_has_reindexable_resource_files() helper that checks
  whether a directory entry list contains any non-metadata resource files
- In _reindex_resource_vectors_from_entries, skip directories that have
  no reindexable resource files (metadata-only directories)
- Added comprehensive tests in test_admin_rebuild_api.py covering:
  - Pure metadata-only directory (should be skipped)
  - Directory with mixed metadata + resource files (should be processed)
  - Directory with only resource files (should be processed)

Files changed:
- openviking/service/reindex_executor.py  (+32 lines)
- tests/server/test_admin_rebuild_api.py   (+144 lines)

Verified: pytest tests/server/test_admin_rebuild_api.py passed (exit 0).
@bhnan

bhnan commented Jun 29, 2026

Copy link
Copy Markdown
Author

Hi @qin-ctx @qin-ptr , friendly ping on this small fix for #1706.
Could anyone help approve the pending workflows and take a look
when convenient? Tests pass locally. Thanks!

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Reindex returns success with zero vectors when directory only contains .overview.md

1 participant