@@ -380,9 +380,15 @@ impl ServiceBasedFrontend {
380380 . map_err ( |err| Box :: new ( err) as Box < dyn ChromaError > ) ?;
381381 if self . enable_schema {
382382 for collection in collections. iter_mut ( ) {
383- collection
384- . reconcile_schema_with_config ( self . default_knn_index )
385- . map_err ( GetCollectionsError :: InvalidSchema ) ?;
383+ if collection. schema . is_none ( ) {
384+ collection. schema = Some (
385+ Schema :: convert_collection_config_to_schema (
386+ & collection. config ,
387+ self . default_knn_index ,
388+ )
389+ . map_err ( GetCollectionsError :: InvalidSchema ) ?,
390+ ) ;
391+ }
386392 }
387393 }
388394 Ok ( collections)
@@ -424,9 +430,15 @@ impl ServiceBasedFrontend {
424430 . map_err ( |err| Box :: new ( err) as Box < dyn ChromaError > ) ?;
425431 if self . enable_schema {
426432 for collection in & mut collections {
427- collection
428- . reconcile_schema_with_config ( self . default_knn_index )
429- . map_err ( GetCollectionError :: InvalidSchema ) ?;
433+ if collection. schema . is_none ( ) {
434+ collection. schema = Some (
435+ Schema :: convert_collection_config_to_schema (
436+ & collection. config ,
437+ self . default_knn_index ,
438+ )
439+ . map_err ( GetCollectionError :: InvalidSchema ) ?,
440+ ) ;
441+ }
430442 }
431443 }
432444 collections
@@ -448,10 +460,14 @@ impl ServiceBasedFrontend {
448460 . await
449461 . map_err ( |err| Box :: new ( err) as Box < dyn ChromaError > ) ?;
450462
451- if self . enable_schema {
452- collection
453- . reconcile_schema_with_config ( self . default_knn_index )
454- . map_err ( GetCollectionByCrnError :: InvalidSchema ) ?;
463+ if self . enable_schema && collection. schema . is_none ( ) {
464+ collection. schema = Some (
465+ Schema :: convert_collection_config_to_schema (
466+ & collection. config ,
467+ self . default_knn_index ,
468+ )
469+ . map_err ( GetCollectionByCrnError :: InvalidSchema ) ?,
470+ ) ;
455471 }
456472 Ok ( collection)
457473 }
@@ -628,10 +644,14 @@ impl ServiceBasedFrontend {
628644 . await ;
629645 // this is done in the case that get_or_create was a get, in which case we should reconcile the schema and config
630646 // that was retrieved from sysdb, rather than the one that was passed in
631- if self . enable_schema {
632- collection
633- . reconcile_schema_with_config ( self . default_knn_index )
634- . map_err ( CreateCollectionError :: InvalidSchema ) ?;
647+ if self . enable_schema && collection. schema . is_none ( ) {
648+ collection. schema = Some (
649+ Schema :: convert_collection_config_to_schema (
650+ & collection. config ,
651+ self . default_knn_index ,
652+ )
653+ . map_err ( CreateCollectionError :: InvalidSchema ) ?,
654+ ) ;
635655 }
636656 Ok ( collection)
637657 }
@@ -733,10 +753,15 @@ impl ServiceBasedFrontend {
733753 target_collection_name,
734754 )
735755 . await ?;
736- collection_and_segments
737- . collection
738- . reconcile_schema_with_config ( self . default_knn_index )
739- . map_err ( ForkCollectionError :: InvalidSchema ) ?;
756+ if collection_and_segments. collection . schema . is_none ( ) {
757+ collection_and_segments. collection . schema = Some (
758+ Schema :: convert_collection_config_to_schema (
759+ & collection_and_segments. collection . config ,
760+ self . default_knn_index ,
761+ )
762+ . map_err ( ForkCollectionError :: InvalidSchema ) ?,
763+ ) ;
764+ }
740765 let collection = collection_and_segments. collection . clone ( ) ;
741766 let latest_collection_logical_size_bytes = collection_and_segments
742767 . collection
0 commit comments