milvus/internal
congqixia 5d0c8b1b40
fix: apply mmap settings correctly during segment load (#46017)
Previously, mmap settings configured at the collection or field level
were not being applied during segment loading in segcore. This was
caused by:

1. A typo in the key name: "mmap.enable" instead of "mmap.enabled"
2. Missing logic to parse and apply mmap settings from schema

This commit fixes the issue by:
- Correcting the key name to "mmap.enabled" to match the standard
- Adding Schema::MmapEnabled() method to retrieve field/collection level
mmap settings with proper fallback logic
- Parsing mmap settings from field type_params and collection properties
during schema parsing
- Applying computed mmap settings in LoadColumnGroup() and Load()
methods instead of hardcoded false values
- Using global MmapConfig as fallback when no explicit setting exists

The mmap setting priority is now:
1. Field-level mmap setting (from type_params)
2. Collection-level mmap setting (from properties)
3. Global mmap config (from MmapManager)

For column groups, if any field has mmap enabled, the entire group uses
mmap (since they are loaded together).

Related issue: #45060

Signed-off-by: Congqi Xia <congqi.xia@zilliz.com>
2025-12-03 10:31:10 +08:00
..