@@ -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
@@ -449,9 +461,15 @@ impl ServiceBasedFrontend {
449461 . map_err ( |err| Box :: new ( err) as Box < dyn ChromaError > ) ?;
450462
451463 if self . enable_schema {
452- collection
453- . reconcile_schema_with_config ( self . default_knn_index )
454- . map_err ( GetCollectionByCrnError :: InvalidSchema ) ?;
464+ if collection. schema . is_none ( ) {
465+ collection. schema = Some (
466+ Schema :: convert_collection_config_to_schema (
467+ & collection. config ,
468+ self . default_knn_index ,
469+ )
470+ . map_err ( GetCollectionByCrnError :: InvalidSchema ) ?,
471+ ) ;
472+ }
455473 }
456474 Ok ( collection)
457475 }
@@ -629,9 +647,15 @@ impl ServiceBasedFrontend {
629647 // this is done in the case that get_or_create was a get, in which case we should reconcile the schema and config
630648 // that was retrieved from sysdb, rather than the one that was passed in
631649 if self . enable_schema {
632- collection
633- . reconcile_schema_with_config ( self . default_knn_index )
634- . map_err ( CreateCollectionError :: InvalidSchema ) ?;
650+ if collection. schema . is_none ( ) {
651+ collection. schema = Some (
652+ Schema :: convert_collection_config_to_schema (
653+ & collection. config ,
654+ self . default_knn_index ,
655+ )
656+ . map_err ( CreateCollectionError :: InvalidSchema ) ?,
657+ ) ;
658+ }
635659 }
636660 Ok ( collection)
637661 }
@@ -733,10 +757,15 @@ impl ServiceBasedFrontend {
733757 target_collection_name,
734758 )
735759 . await ?;
736- collection_and_segments
737- . collection
738- . reconcile_schema_with_config ( self . default_knn_index )
739- . map_err ( ForkCollectionError :: InvalidSchema ) ?;
760+ if collection_and_segments. collection . schema . is_none ( ) {
761+ collection_and_segments. collection . schema = Some (
762+ Schema :: convert_collection_config_to_schema (
763+ & collection_and_segments. collection . config ,
764+ self . default_knn_index ,
765+ )
766+ . map_err ( ForkCollectionError :: InvalidSchema ) ?,
767+ ) ;
768+ }
740769 let collection = collection_and_segments. collection . clone ( ) ;
741770 let latest_collection_logical_size_bytes = collection_and_segments
742771 . collection
0 commit comments