1111
1212#include " glean/rts/timer.h"
1313
14- #ifndef OSS
15- #include " justknobs/JustKnobProxy.h"
16- #endif
17-
1814namespace facebook {
1915namespace glean {
2016namespace rocks {
@@ -29,7 +25,6 @@ const char* admin_names[] = {
2925 " FIRST_UNIT_ID" ,
3026 " NEXT_UNIT_ID" ,
3127 " ORPHAN_FACTS" ,
32- " OWNERSHIP_FORMAT_VERSION" ,
3328};
3429
3530namespace {
@@ -150,37 +145,10 @@ DatabaseImpl::DatabaseImpl(
150145 rts::error (" unexpected database version {}" , db_version);
151146 }
152147
153- // Initialize ownership format version
154- // For new DBs: Check JustKnob to decide whether to use 64-bit or 32-bit
155- // format. For existing DBs: if no version marker exists, assume 32-bit format
156- // Both formats are always readable regardless of gatekeeper value
157- if (container_.mode == Mode::Create) {
158- // New DB: check JustKnob to determine format
159- #ifndef OSS
160- static facebook::jk::BooleanKnob use64BitOwnership (
161- " glean/ownership:64_bit_ids" );
162- uint32_t format_to_use = use64BitOwnership ()
163- ? OWNERSHIP_FORMAT_VERSION_64BIT
164- : OWNERSHIP_FORMAT_VERSION_32BIT ;
165- #else
166- // OSS builds always use 32-bit format for now
167- uint32_t format_to_use = OWNERSHIP_FORMAT_VERSION_32BIT ;
168- #endif
169- ownership_format_version = static_cast <uint32_t >(initAdminValue (
170- container_,
171- AdminId::OWNERSHIP_FORMAT_VERSION ,
172- static_cast <uint64_t >(format_to_use),
173- true , // write
174- [] {}));
175- } else {
176- // Existing DB: read format version, default to 32-bit if not present
177- ownership_format_version = static_cast <uint32_t >(initAdminValue (
178- container_,
179- AdminId::OWNERSHIP_FORMAT_VERSION ,
180- static_cast <uint64_t >(OWNERSHIP_FORMAT_VERSION_32BIT ),
181- false , // don't write
182- [] {}));
183- }
148+ ownership_format_version =
149+ version == 3
150+ ? OWNERSHIP_FORMAT_VERSION_32BIT
151+ : OWNERSHIP_FORMAT_VERSION_64BIT ;
184152
185153 VLOG (1 ) << folly::sformat (
186154 " ownership_format_version: {} ({})" ,
0 commit comments