[Enhance]: Creating a RocksDB instance rewrites the OPTIONS file once per column family
Los mantenedores suelen responder en 1 día
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Affected Component
RocksdbContext::create() in src/db/common/rocksdb_context.cc, used for every new scalar index and FTS RocksDB instance (collection create, every segment rollover, index builds).
Current Behavior
create() adds the column families of a new instance one at a time:
RocksDB's DB::CreateColumnFamily() writes and syncs a complete new OPTIONS file on every call, besides its MANIFEST record. Creating N families therefore writes N OPTIONS files of growing size.
Reproduction on 98aa126 (no source change; main at 7f54d94 does not change this file), macOS arm64: a unit test creates one instance without families and one with 24 families, then compares the newest OPTIONS-<number> file in each directory.
- Without families:
OPTIONS-000007. - With 24 families:
OPTIONS-000055, so the 24 calls took 48 more file numbers. - With one
DB::CreateColumnFamilies()call:OPTIONS-000009.
A collection creates one such instance per segment, with one family per indexed field and index kind, so this cost repeats on create and on every segment rollover.
Desired Improvement
Create all families with one DB::CreateColumnFamilies() call. RocksDB 8.1.1 still writes one MANIFEST record per family, but writes the OPTIONS file once. Durability does not change. The handle order in cf_handles_ and the failure path (destroy the handles created so far, close the database) stay as they are.
Impact
Fewer file writes and syncs on collection create and segment rollover. In a process-crash test that kills the rollover before each file-system mutation, a rollover of a 4-field collection made 249 mutations and 80 syncs on 98aa126, and 132 mutations and 44 syncs with this change plus the seal change in the related issue #798 (both together; not measured separately).
RocksDB's own issue about the per-family OPTIONS rewrite: facebook/rocksdb#12888.
I have a patch of about 30 lines with three tests (CreateWritesOptionsFileOnce, CreateKeepsHandleOrder, CreateFailureLeavesNoOpenHandles) and can open a PR if this approach is welcome.
- Lenguaje dominante
- C++
- Estrellas
- 16.3k
- Forks
- 1k
- Merge medio
- 2 d 10 h
- PR fusionados (30 d)
- 32
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de alibaba/zvec
-
[Feature]: IVF_TIEREDQ index type, with a learned variable-bit codec (25–44% less index memory than `IVF_RABITQ` at equal recall)Posiblemente ocupada @richyreachy la tomó hace 7 días. Abiertofeature
alibaba/zvec#909 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Support an opt-in portable x86 FastPFOR build without SSE4.1Posiblemente ocupada @egolearner la tomó hace 20 días. Abierto
alibaba/zvec#875 · 1 comentario · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Enhance]: Reduce vector index block fragmentation caused by frequent flushesPosiblemente ocupada @feihongxu0824 la tomó hace 22 días. Abiertoenhancement
alibaba/zvec#869 · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Performance]:High-selectivity range filter materializes a full bitmap — `bitset_set_list` ~49% CPU, dwarfing the ANN searchPosiblemente ocupada @zhourrr la tomó hace 22 días. Abiertoenhancement
alibaba/zvec#868 · 13 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
[Performance] Warm-query latency on small collections with query() and query_internal_ids() in v0.8.0Quizá libre de nuevo @egolearner la tomó hace 33 días y no hay ningún pull request abierto. Abierto
alibaba/zvec#841 · 2 asignados ·
Los mantenedores suelen responder en 1 día
Todos los issues de alibaba/zvec
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
-
deprecation internal refactor
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
realloc(ptr, 0) on glibc leaves the freed block in the capture as a leakPosiblemente ocupada @ADAMAMZAR la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
bloomberg/memray#1097 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
new-compilers request
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
compiler-explorer/compiler-explorer#9640 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
deepseek-ai/DeepEP#839 ·
Los mantenedores suelen responder en 6 días