From 49939f5f2bc9d8731262aa100c7298cab1ef0e02 Mon Sep 17 00:00:00 2001 From: foxspy Date: Wed, 31 Dec 2025 11:07:22 +0800 Subject: [PATCH] fix: enable diskann option by default (#46584) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit issue: #46481 - Core invariant: DiskANN requires OS support for asynchronous I/O (AIO); the Makefile now encodes this by defaulting disk_index=OFF on Darwin (macOS) and disk_index=ON on other OSes where AIO is available. - Simplified logic: the build-time default was inverted for non-Darwin platforms so DiskANN is enabled by default; redundant conditional handling that previously forced OFF everywhere has been removed in favor of an OS-based default while preserving the single manual override variable. - No data loss or regression: this is a compile-time change only — it toggles inclusion of DiskANN code paths at build time and does not modify runtime persistence or existing index files. macOS builds still skip AIO-dependent DiskANN code paths, and Linux/other builds merely compile support by default; no migration or runtime data-path changes are introduced. - Backward compatibility / fix for issue #46481: addresses the reported need to enable DiskANN by default (issue #46481) while keeping explicit disk_index overrides intact for CI and developer workflows, so existing build scripts and deployments that pass disk_index continue to behave unchanged. Signed-off-by: xianliang.li --- Makefile | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index c5cd18dfcc..890a4e15f6 100644 --- a/Makefile +++ b/Makefile @@ -22,9 +22,17 @@ PGO_PATH := $(PWD)/configs/pgo OS := $(shell uname -s) mode = Release -use_disk_index = OFF +# Set disk_index default based on OS +# macOS (Darwin) does not support aio, so disable disk_index +ifeq ($(OS),Darwin) + use_disk_index = OFF +else + use_disk_index = ON +endif + +# Allow manual override via disk_index variable ifdef disk_index - use_disk_index = ${disk_index} + use_disk_index = ${disk_index} endif use_asan = OFF