+ DeleteCollection(t, toBeDeletedCollectionUuid)
+ DeleteCollection(t, secondOfTwoWithSameDataUuid)
+
+ // Run data manager again
+ time.Sleep(1 * time.Second)
+ DataManagerSingleRun(t)
+ WaitUntilQueuesFinishWork(t)
+
+ // Get block indexes and verify that all backdated blocks except the first one are not included.
+ // The first block was also used in a collection that is not deleted and hence should remain.
+ var notExpected []string
+ notExpected = append(notExpected, oldBlockLocators[1:]...)
+
+ expected = expected[:0]
+ expected = append(expected, oldBlockLocators[0])
+ expected = append(expected, newBlockLocators...)
+ expected = append(expected, toBeDeletedCollectionLocator)
+ expected = append(expected, replicationCollectionLocator)
+ expected = append(expected, oneOfTwoWithSameDataLocator)
+ expected = append(expected, secondOfTwoWithSameDataLocator)
+
+ VerifyBlocks(t, notExpected, expected)
+
+ // Reduce replication on replicationCollectionUuid collection and verify that the overreplicated blocks are untouched.
+
+ // Default replication level is 2; first verify that the replicationCollectionLocator appears in both volumes
+ for i := 0; i < len(keepServers); i++ {
+ indexes := GetBlockIndexesForServer(t, i)
+ if !ValueInArray(replicationCollectionLocator, indexes) {
+ t.Fatalf("Not found block in index %s", replicationCollectionLocator)
+ }
+ }
+
+ // Now reduce replication level on this collection and verify that it still appears in both volumes
+ UpdateCollection(t, replicationCollectionUuid, "replication_desired", "1")
+ collection := GetCollection(t, replicationCollectionUuid)
+ if collection["replication_desired"].(interface{}) != float64(1) {
+ t.Fatalf("After update replication_desired is not 1; instead it is %v", collection["replication_desired"])
+ }