Skip to content

Commit bf56796

Browse files
[BUG]: fix missing tenant ID in version file (chroma-core#4408)
2 parents dddd37d + a43b1f3 commit bf56796

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

go/pkg/sysdb/coordinator/table_catalog.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1555,6 +1555,10 @@ func (tc *Catalog) FlushCollectionCompactionForVersionedCollection(ctx context.C
15551555
return nil, err
15561556
}
15571557

1558+
// There was previously a bug that resulted in the tenant ID missing from some version files (https://github.com/chroma-core/chroma/pull/4408).
1559+
// This line can be removed once all corrupted version files are fixed.
1560+
existingVersionFilePb.CollectionInfoImmutable.TenantId = collectionEntry.Tenant
1561+
15581562
// Do a simple validation of the version file.
15591563
err = tc.validateVersionFile(existingVersionFilePb, collectionEntry.ID, existingVersion)
15601564
if err != nil {

go/pkg/sysdb/metastore/db/dao/collection.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func (s *collectionDb) DeleteAll() error {
3030
func (s *collectionDb) GetCollectionEntry(collectionID *string, databaseName *string) (*dbmodel.Collection, error) {
3131
var collections []*dbmodel.Collection
3232
query := s.db.Table("collections").
33-
Select("collections.id, collections.name, collections.database_id, collections.is_deleted, databases.tenant_id, collections.version, collections.version_file_name, collections.root_collection_id").
33+
Select("collections.id, collections.name, collections.database_id, collections.is_deleted, collections.tenant, collections.version, collections.version_file_name, collections.root_collection_id").
3434
Joins("INNER JOIN databases ON collections.database_id = databases.id").
3535
Where("collections.id = ?", collectionID)
3636

0 commit comments

Comments
 (0)