[Enhance]: Creating a RocksDB instance rewrites the OPTIONS file once per column family
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- C++
- Star
- 16.3k
- Fork
- 1k
- Merge trung bình
- 2 ngày 10 giờ
- Pull request đã merge (30 ngày)
- 32
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của alibaba/zvec
-
[Feature]: IVF_TIEREDQ index type, with a learned variable-bit codec (25–44% less index memory than `IVF_RABITQ` at equal recall)Có thể đã có người làm @richyreachy đã nhận 7 ngày trước. Đang mởfeature
alibaba/zvec#909 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Support an opt-in portable x86 FastPFOR build without SSE4.1Có thể đã có người làm @egolearner đã nhận 20 ngày trước. Đang mở
alibaba/zvec#875 · 1 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Enhance]: Reduce vector index block fragmentation caused by frequent flushesCó thể đã có người làm @feihongxu0824 đã nhận 22 ngày trước. Đang mởenhancement
alibaba/zvec#869 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Performance]:High-selectivity range filter materializes a full bitmap — `bitset_set_list` ~49% CPU, dwarfing the ANN searchCó thể đã có người làm @zhourrr đã nhận 22 ngày trước. Đang mởenhancement
alibaba/zvec#868 · 13 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Performance] Warm-query latency on small collections with query() and query_internal_ids() in v0.8.0Có thể làm lại được @egolearner đã nhận 33 ngày trước và không có pull request nào đang mở. Đang mở
alibaba/zvec#841 · 2 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
Maintainer thường phản hồi trong vòng 1 ngày
-
compatibility difficulty:easy prio:low
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
NatronGitHub/openfx-misc#390 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
-
deprecation internal refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày