2020import com .linkedin .davinci .config .VeniceServerConfig ;
2121import com .linkedin .davinci .ingestion .DefaultIngestionBackend ;
2222import com .linkedin .davinci .ingestion .IngestionBackend ;
23- import com .linkedin .davinci .ingestion .IsolatedIngestionBackend ;
24- import com .linkedin .davinci .ingestion .main .MainIngestionStorageMetadataService ;
25- import com .linkedin .davinci .ingestion .utils .IsolatedIngestionUtils ;
2623import com .linkedin .davinci .kafka .consumer .KafkaStoreIngestionService ;
2724import com .linkedin .davinci .notifier .VeniceNotifier ;
2825import com .linkedin .davinci .repository .VeniceMetadataRepositoryBuilder ;
2926import com .linkedin .davinci .stats .AggBlobTransferStats ;
3027import com .linkedin .davinci .stats .AggVersionedBlobTransferStats ;
3128import com .linkedin .davinci .stats .AggVersionedStorageEngineStats ;
3229import com .linkedin .davinci .stats .HeartbeatMonitoringServiceStats ;
33- import com .linkedin .davinci .stats .MetadataUpdateStats ;
3430import com .linkedin .davinci .stats .RocksDBMemoryStats ;
3531import com .linkedin .davinci .stats .ingestion .heartbeat .HeartbeatMonitoringService ;
3632import com .linkedin .davinci .storage .StorageEngineMetadataService ;
3733import com .linkedin .davinci .storage .StorageMetadataService ;
3834import com .linkedin .davinci .storage .StorageService ;
39- import com .linkedin .davinci .store .StorageEngine ;
4035import com .linkedin .davinci .store .cache .backend .ObjectCacheBackend ;
4136import com .linkedin .davinci .store .cache .backend .ObjectCacheConfig ;
4237import com .linkedin .venice .annotation .VisibleForTesting ;
5146import com .linkedin .venice .kafka .protocol .state .PartitionState ;
5247import com .linkedin .venice .kafka .protocol .state .StoreVersionState ;
5348import com .linkedin .venice .meta .ClusterInfoProvider ;
54- import com .linkedin .venice .meta .IngestionMode ;
5549import com .linkedin .venice .meta .ReadOnlySchemaRepository ;
5650import com .linkedin .venice .meta .ReadOnlyStoreRepository ;
5751import com .linkedin .venice .meta .Store ;
@@ -156,7 +150,7 @@ public DaVinciBackend(
156150 metricsRepository = Optional .ofNullable (clientConfig .getMetricsRepository ())
157151 .orElse (TehutiUtils .getMetricsRepository (DAVINCI_CLIENT .getName ()));
158152 VeniceMetadataRepositoryBuilder veniceMetadataRepositoryBuilder =
159- new VeniceMetadataRepositoryBuilder (configLoader , clientConfig , metricsRepository , icProvider , false );
153+ new VeniceMetadataRepositoryBuilder (configLoader , clientConfig , metricsRepository , icProvider );
160154
161155 ClusterInfoProvider clusterInfoProvider = veniceMetadataRepositoryBuilder .getClusterInfoProvider ();
162156 ReadOnlyStoreRepository readOnlyStoreRepository = veniceMetadataRepositoryBuilder .getStoreRepo ();
@@ -195,35 +189,17 @@ public DaVinciBackend(
195189 backendConfig .getRocksDBServerConfig ().isRocksDBPlainTableFormatEnabled ())
196190 : null ;
197191
198- // Add extra safeguards here to ensure we have released RocksDB database locks before we initialize storage
199- // services.
200- IsolatedIngestionUtils .destroyLingeringIsolatedIngestionProcess (configLoader );
201192 /**
202193 * The constructor of {@link #storageService} will take care of unused store/store version cleanup.
203- *
204- * When Ingestion Isolation is enabled, we don't want to restore data partitions here:
205- * 1. It is a waste of effort since all the opened partitioned will be closed right after.
206- * 2. When DaVinci memory limiter is enabled, currently, SSTFileManager doesn't clean up the entries belonging
207- * to the closed database, which means when the Isolated process hands the database back to the main process,
208- * some removed SST files (some SST files can be removed in Isolated Process because of log compaction) will
209- * remain in SSTFileManager tracked file list.
210- * 3. We still want to open metadata partition, otherwise {@link StorageService} won't scan the local db folder.
211- * Also opening metadata partition in main process won't cause much side effect from DaVinci memory limiter's
212- * POV, since metadata partition won't be handed back to main process in the future.
213- * 4. When Ingestion Isolation is enabled with suppressing live update feature, main process needs to open all the
214- * data partitions since Isolated Process won't re-ingest the existing partitions.
215194 */
216- boolean whetherToRestoreDataPartitions = !isIsolatedIngestion ()
217- || configLoader .getVeniceServerConfig ().freezeIngestionIfReadyToServeOrLocalDataExists ();
218- LOGGER .info ("DaVinci {} restore data partitions." , whetherToRestoreDataPartitions ? "will" : "won't" );
219195 storageService = new StorageService (
220196 configLoader ,
221197 aggVersionedStorageEngineStats ,
222198 rocksDBMemoryStats ,
223199 storeVersionStateSerializer ,
224200 partitionStateSerializer ,
225201 storeRepository ,
226- whetherToRestoreDataPartitions ,
202+ true ,
227203 true ,
228204 functionToCheckWhetherStorageEngineShouldBeKeptOrNot (managedClients ));
229205 storageService .start ();
@@ -245,14 +221,8 @@ public DaVinciBackend(
245221 LOGGER .info ("Successfully verified the latest protocols at runtime are valid in Venice backend." );
246222 }
247223
248- storageMetadataService = backendConfig .getIngestionMode ().equals (IngestionMode .ISOLATED )
249- ? new MainIngestionStorageMetadataService (
250- backendConfig .getIngestionServicePort (),
251- partitionStateSerializer ,
252- new MetadataUpdateStats (metricsRepository ),
253- configLoader ,
254- storageService .getStoreVersionStateSyncer ())
255- : new StorageEngineMetadataService (storageService .getStorageEngineRepository (), partitionStateSerializer );
224+ storageMetadataService =
225+ new StorageEngineMetadataService (storageService .getStorageEngineRepository (), partitionStateSerializer );
256226 // Start storage metadata service
257227 ((AbstractVeniceService ) storageMetadataService ).start ();
258228 compressorFactory = new StorageEngineBackedCompressorFactory (storageMetadataService );
@@ -282,7 +252,6 @@ public DaVinciBackend(
282252 partitionStateSerializer ,
283253 Optional .empty (),
284254 null ,
285- false ,
286255 compressorFactory ,
287256 cacheBackend ,
288257 true ,
@@ -315,17 +284,7 @@ public DaVinciBackend(
315284
316285 ingestionService .start ();
317286
318- if (isIsolatedIngestion () && cacheConfig .isPresent ()) {
319- // TODO: There are 'some' cases where this mix might be ok, (like a batch only store, or with certain TTL
320- // settings),
321- // could add further validation. If the process isn't ingesting data, then it can't maintain the object cache
322- // with
323- // a correct view of the data.
324- throw new IllegalArgumentException (
325- "Ingestion isolated and Cache are incompatible configs!! Aborting start up!" );
326- }
327-
328- if (BlobTransferUtils .isBlobTransferManagerEnabled (backendConfig , isIsolatedIngestion ())) {
287+ if (BlobTransferUtils .isBlobTransferManagerEnabled (backendConfig )) {
329288 aggVersionedBlobTransferStats =
330289 new AggVersionedBlobTransferStats (metricsRepository , storeRepository , configLoader .getVeniceServerConfig ());
331290 aggBlobTransferStats =
@@ -441,41 +400,12 @@ private Function<String, Boolean> functionToCheckWhetherStorageEngineShouldBeKep
441400
442401 @ VisibleForTesting
443402 final synchronized void bootstrap () {
444- /**
445- * In order to make bootstrap logic compatible with ingestion isolation, we first scan all local storage engines,
446- * record all store versions that are up-to-date and close all storage engines. This will make sure child process
447- * can open RocksDB stores.
448- */
449- if (isIsolatedIngestion ()) {
450- if (configLoader .getVeniceServerConfig ().freezeIngestionIfReadyToServeOrLocalDataExists ()) {
451- /**
452- * In this case we will only need to close metadata partition, as it is supposed to be opened and managed by
453- * forked ingestion process via following subscribe call.
454- */
455- for (StorageEngine storageEngine : getStorageService ().getStorageEngineRepository ()
456- .getAllLocalStorageEngines ()) {
457- storageEngine .closeMetadataPartition ();
458- }
459- } else {
460- getStorageService ().closeAllStorageEngines ();
461- }
462- }
463-
464- ingestionBackend = isIsolatedIngestion ()
465- ? new IsolatedIngestionBackend (
466- configLoader ,
467- metricsRepository ,
468- storageMetadataService ,
469- ingestionService ,
470- getStorageService (),
471- blobTransferManager ,
472- this ::getVeniceCurrentVersionNumber )
473- : new DefaultIngestionBackend (
474- storageMetadataService ,
475- ingestionService ,
476- getStorageService (),
477- blobTransferManager ,
478- configLoader .getVeniceServerConfig ());
403+ ingestionBackend = new DefaultIngestionBackend (
404+ storageMetadataService ,
405+ ingestionService ,
406+ getStorageService (),
407+ blobTransferManager ,
408+ configLoader .getVeniceServerConfig ());
479409 ingestionBackend .addIngestionNotifier (ingestionListener );
480410 }
481411
@@ -636,10 +566,6 @@ protected void deleteStore(String storeName) {
636566 }
637567 }
638568
639- public final boolean isIsolatedIngestion () {
640- return configLoader .getVeniceServerConfig ().getIngestionMode ().equals (IngestionMode .ISOLATED );
641- }
642-
643569 // Move the logic to this protected method to make it visible for unit test.
644570 protected void handleStoreChanged (StoreBackend storeBackend ) {
645571 // Skip version swaps for version-specific stores
0 commit comments