Skip to content

librados, osd: add PG-LSH vector placement and routing#9

Open
ppomee2002 wants to merge 7 commits into
myoungwon:wip-vector-nativefrom
ppomee2002:pr-pg-lsh-v0-routing
Open

librados, osd: add PG-LSH vector placement and routing#9
ppomee2002 wants to merge 7 commits into
myoungwon:wip-vector-nativefrom
ppomee2002:pr-pg-lsh-v0-routing

Conversation

@ppomee2002

@ppomee2002 ppomee2002 commented Jul 15, 2026

Copy link
Copy Markdown

PG-LSH placement policy 추가

vector_placement_algorithm_pg_lsh_v0 추가

vector_placement.h에 PG-LSH 공통 함수 추가

  • vector를 table별 LSH signature로 변환
  • (table, signature) 조합을 raw PG 번호로 매핑
  • put에서는 처음 나오는 unique PG D개 선택
  • query에서는 exact group과 hamming group에서 unique PG M개 선택
  • 현재는 vote aggregation이 아니라 group 생성 순서대로 PG를 선택

++vote 방식이 효과가 미미하여 뺐습니다


PG 기반 librados routing 추가

vector_pg_lsh.h에 PG-LSH planner 추가

  • K, L, seed, hamming_radius, D, M 검증
  • get_object_pg_hash_position2()로 locator key가 실제 어느 PG로 가는지 확인

--> Object name은 PG별 vector container 형태로 생성

.rados.vector/v1/pg-lsh-v0/<bucket_hash>/<index_hash>/pg정보
pg_는 logical object layout에 사용하고 실제 raw PG routing은 IoCtxImpl::oloc.key에 locator key를 설정하여 처리합니다
vector_hash는 object나 PG 선택에서 뺐습니다(hash-v0에서는 사용했었음)


put_vector path 연결

put_vector()에서 vector의 LSH signature를 계산, write 대상 PG D개 선택

각 PG에 대해

  • pg_ object 생성
  • 해당 PG로 매핑되는 locator key 조회
  • IoCtxImpl::oloc.key에 locator key 설정
  • target object에 put_vector op 전송
  • op 완료 후 기존 locator key 복구

하나의 vector는 설정된 D에 따라 여러 PG object에 중복 저장


  • query_vectors path 연결
  • OSD query scan 통계 추가

Comment thread src/librados/librados_cxx.cc Outdated
::ObjectOperation op;
op.put_vector(payload);

IoCtxImpl *impl = vector_internal::IoCtxAccess::get(ioctx);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아예 복사를 하면 아래처럼 다시 셋팅을 하는 복잡함이 없어질 듯 합니다.

Comment thread src/include/rados/vector_ops.h Outdated

void encode(ceph::bufferlist& bl) const {
ENCODE_START(1, 1, bl);
ENCODE_START(2, 1, bl);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1

@@ -6,7 +6,11 @@

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

librados: add PG-LSH vector placement policy <-- 이 커밋 자체가 어디에 쓰이는 함수들인지 .....................

vector_placement::hash_v0_vector_hash(vector_data);
for (uint32_t table = 0; table < table_count; ++table) {
const uint32_t signature =
vector_placement::lsh_v0_signature(values, table, signature_bits);

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

시그니처가 무슨 의미일까요?

@ppomee2002
ppomee2002 force-pushed the pr-pg-lsh-v0-routing branch from fc42c20 to 1a874b8 Compare July 16, 2026 08:49
@ppomee2002
ppomee2002 force-pushed the pr-pg-lsh-v0-routing branch from 1a874b8 to 64ff137 Compare July 16, 2026 09:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants