Skip to content

Commit 1477dd2

Browse files
authored
Enable distributed resync if EE (#8340)
1 parent 0d47bc6 commit 1477dd2

8 files changed

Lines changed: 771 additions & 906 deletions

db/background_mgr_resync_dcp_test.go

Lines changed: 259 additions & 302 deletions
Large diffs are not rendered by default.

db/database.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,7 @@ func NewDatabaseContext(ctx context.Context, dbName string, bucket base.Bucket,
624624
return nil, err
625625
}
626626

627-
distributedResync := false // when ready, this will flip to db.useShardedDCP()
627+
distributedResync := dbContext.useShardedDCP()
628628
dbContext.ResyncManager = NewResyncManagerDCP(dbContext, distributedResync)
629629
dbContext.AsyncIndexInitManager = NewAsyncIndexInitManager(metadataStore, dbContext.MetadataKeys)
630630

db/database_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ func setupTestDBAllowConflicts(t testing.TB) (*Database, context.Context) {
4848
dbcOptions := DatabaseContextOptions{
4949
AllowConflicts: base.Ptr(true),
5050
CacheOptions: base.Ptr(DefaultCacheOptions()),
51+
UnsupportedOptions: &UnsupportedOptions{
52+
ResyncPartitions: base.Ptr(uint16(2)),
53+
},
5154
}
5255
return SetupTestDBWithOptions(t, dbcOptions)
5356
}

db/util_testing.go

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1191,27 +1191,3 @@ func (db *DatabaseContext) RestartChangeListener(t testing.TB, flushCache bool)
11911191
func (db *DatabaseContext) FlushChannelCache(t testing.TB) {
11921192
db.RestartChangeListener(t, true)
11931193
}
1194-
1195-
type ResyncTestCase struct {
1196-
Name string // name of test case
1197-
Distributed bool // use distributed resync
1198-
}
1199-
1200-
// ResyncTestModes returns the test modes to run resync tests in for a given test run. Distributed resync requires Couchbase Server and EE.
1201-
func ResyncTestModes() []ResyncTestCase {
1202-
testCases := []ResyncTestCase{
1203-
{
1204-
Name: "distributed=false",
1205-
Distributed: false,
1206-
},
1207-
}
1208-
/* CBG-5419 enable tests
1209-
if !base.UnitTestUrlIsWalrus() && base.IsEnterpriseEdition() {
1210-
testCases = append(testCases, ResyncTestCase{
1211-
Name: "distributed=true",
1212-
Distributed: true,
1213-
})
1214-
}
1215-
*/
1216-
return testCases
1217-
}

0 commit comments

Comments
 (0)