Skip to content

Commit d9e7a48

Browse files
committed
[ENH]: Modified AttachFunction to do 2PC on a new is_ready column
1 parent ecd3278 commit d9e7a48

File tree

16 files changed

+533
-520
lines changed

16 files changed

+533
-520
lines changed

chromadb/test/distributed/test_task_api.py

Lines changed: 207 additions & 205 deletions
Large diffs are not rendered by default.

go/pkg/sysdb/coordinator/create_task_test.go

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"testing"
66
"time"
77

8-
"github.com/chroma-core/chroma/go/pkg/common"
9-
108
"github.com/chroma-core/chroma/go/pkg/memberlist_manager"
119
"github.com/chroma-core/chroma/go/pkg/proto/coordinatorpb"
1210
"github.com/chroma-core/chroma/go/pkg/sysdb/metastore/db/dbmodel"
@@ -225,10 +223,10 @@ func (suite *AttachFunctionTestSuite) TestAttachFunction_SuccessfulCreation() {
225223
// Execute AttachFunction
226224
response, err := suite.coordinator.AttachFunction(ctx, request)
227225

228-
// Assertions - heap service is not enabled in this test setup
229-
suite.Error(err)
230-
suite.Nil(response)
231-
suite.ErrorIs(err, common.ErrHeapServiceNotEnabled)
226+
// Assertions - AttachFunction now succeeds without heap service, creating attached function with is_ready=false
227+
suite.NoError(err)
228+
suite.NotNil(response)
229+
suite.NotEmpty(response.Id)
232230

233231
// Verify all mocks were called as expected
234232
suite.mockMetaDomain.AssertExpectations(suite.T())
@@ -407,11 +405,11 @@ func (suite *AttachFunctionTestSuite) TestAttachFunction_RecoveryFlow() {
407405
_ = txFunc(context.Background())
408406
}).Return(nil).Once()
409407

410-
// First AttachFunction call - should fail at heap push
408+
// First AttachFunction call - should succeed, creating attached function with is_ready=false
411409
response1, err1 := suite.coordinator.AttachFunction(ctx, request)
412-
suite.Error(err1)
413-
suite.Nil(response1)
414-
suite.Contains(err1.Error(), "heap service")
410+
suite.NoError(err1)
411+
suite.NotNil(response1)
412+
suite.NotEmpty(response1.Id)
415413

416414
// ========== GetAttachedFunctionByName: Should Return ErrAttachedFunctionNotReady ==========
417415

0 commit comments

Comments
 (0)