Skip to content

Commit cb3c95f

Browse files
committed
fix: migrate
1 parent c245527 commit cb3c95f

4 files changed

Lines changed: 3 additions & 56 deletions

File tree

src/cluster/slot_migrate.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -718,11 +718,6 @@ StatusOr<KeyMigrationResult> SlotMigrator::migrateOneKey(const rocksdb::Slice &k
718718
}
719719
break;
720720
}
721-
case kRedisCuckooFilter: {
722-
return {Status::NotOK,
723-
"unsupported migration type: MBbloomCF command migration is not supported; "
724-
"use raw key-value migration"};
725-
}
726721
case kRedisHyperLogLog: {
727722
// HyperLogLog migration by cmd is not supported,
728723
// since it's hard to restore the same key structure for HyperLogLog

src/storage/batch_extractor.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,6 @@ rocksdb::Status WriteBatchExtractor::PutCF(uint32_t column_family_id, const Slic
6060
Metadata metadata(kRedisNone);
6161
auto s = metadata.Decode(value);
6262
if (!s.ok()) return s;
63-
if (metadata.Type() == kRedisCuckooFilter) {
64-
return rocksdb::Status::NotSupported("MBbloomCF command migration is not supported; use raw key-value migration");
65-
}
6663

6764
if (metadata.Type() == kRedisString) {
6865
command_args = {"SET", user_key, value.ToString().substr(Metadata::GetOffsetAfterExpire(value[0]))};
@@ -264,9 +261,6 @@ rocksdb::Status WriteBatchExtractor::PutCF(uint32_t column_family_id, const Slic
264261
}
265262
break;
266263
}
267-
case kRedisCuckooFilter:
268-
return rocksdb::Status::NotSupported(
269-
"MBbloomCF command migration is not supported; use raw key-value migration");
270264
// TODO: to implement the case of kRedisBloomFilter
271265
default:
272266
break;

tests/cppunit/types/cuckoo_filter_test.cc

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
#include <vector>
2727

2828
#include "common/encoding.h"
29-
#include "storage/batch_extractor.h"
3029
#include "storage/redis_db.h"
3130
#include "storage/redis_metadata.h"
3231
#include "test_base.h"
@@ -395,47 +394,6 @@ TEST_F(RedisCuckooFilterTest, MetadataEncodeDecodeRoundTrip) {
395394
EXPECT_EQ(decoded.page_size, metadata.page_size);
396395
}
397396

398-
TEST(CuckooFilterMigrationTest, CommandBatchExtractorRejectsCuckooFilterMetadata) {
399-
CuckooChainMetadata metadata(false);
400-
metadata.version = 1;
401-
metadata.size = 1;
402-
metadata.n_filters = 1;
403-
metadata.expansion = 1;
404-
metadata.base_capacity = 1000;
405-
metadata.bucket_size = 2;
406-
metadata.max_iterations = 20;
407-
metadata.page_size = kCuckooFilterDefaultPageSize;
408-
409-
std::string encoded;
410-
metadata.Encode(&encoded);
411-
std::string ns_key;
412-
PutFixed8(&ns_key, 0);
413-
ns_key += "key";
414-
415-
WriteBatchExtractor extractor(false);
416-
auto s = extractor.PutCF(static_cast<uint32_t>(ColumnFamilyID::Metadata), ns_key, encoded);
417-
ASSERT_TRUE(s.IsNotSupported()) << s.ToString();
418-
EXPECT_NE(s.ToString().find("MBbloomCF command migration is not supported"), std::string::npos);
419-
}
420-
421-
TEST(CuckooFilterMigrationTest, CommandBatchExtractorRejectsCuckooFilterPages) {
422-
WriteBatchExtractor extractor(false);
423-
redis::WriteBatchLogData log_data(kRedisCuckooFilter, {"add", "key"});
424-
extractor.LogData(log_data.Encode());
425-
426-
std::string sub_key;
427-
PutFixed16(&sub_key, 0);
428-
PutFixed32(&sub_key, 0);
429-
std::string ns_key;
430-
PutFixed8(&ns_key, 0);
431-
ns_key += "key";
432-
auto page_key = InternalKey(ns_key, sub_key, 1, false).Encode();
433-
434-
auto s = extractor.PutCF(static_cast<uint32_t>(ColumnFamilyID::PrimarySubkey), page_key, std::string(4, '\1'));
435-
ASSERT_TRUE(s.IsNotSupported()) << s.ToString();
436-
EXPECT_NE(s.ToString().find("MBbloomCF command migration is not supported"), std::string::npos);
437-
}
438-
439397
TEST_F(RedisCuckooFilterTest, ReserveVerifyMetadata) {
440398
uint64_t capacity = 1000;
441399
uint8_t bucket_size = 4;

tests/gocase/integration/replication/replication_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,10 @@ func TestReplicationWithLimitSpeed(t *testing.T) {
357357
util.Populate(t, slaveClient, "", 1026, 1)
358358

359359
t.Run("resume broken transfer based files", func(t *testing.T) {
360+
// Try to transfer some files, because max-replication-mb 1,
361+
// so maybe more than 5 files are transferred for sleep 5s.
360362
util.SlaveOf(t, slaveClient, master)
361-
require.Eventually(t, func() bool {
362-
return slave.LogFileMatches(t, `.*\[fetch\] Fetched .*`)
363-
}, 50*time.Second, time.Second)
363+
time.Sleep(5 * time.Second)
364364

365365
// Restart master server, let the slave try to full sync with master again,
366366
// because slave already received some SST files, so we will skip them.

0 commit comments

Comments
 (0)