-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: delete slot #2251
fix: delete slot #2251
Conversation
fix: delete slot
…xficsol-delete_slot
src/pika_command.cc
Outdated
const HintKeys& hint_keys) { | ||
pstd::lock::MultiRecordLock record_lock(slot->LockMgr()); | ||
void Cmd::InternalProcessCommand(const HintKeys& hint_keys) { | ||
LOG(INFO) << "xaz"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
src/pika_command.cc
Outdated
if (is_write()) { | ||
record_lock.Lock(current_key()); | ||
} | ||
|
||
LOG(INFO) << "wxr"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
include/pika_conf.h
Outdated
@@ -621,8 +621,6 @@ class PikaConf : public pstd::BaseConf { | |||
|
|||
private: | |||
pstd::Status InternalGetTargetDB(const std::string& db_name, uint32_t* target); | |||
|
|||
private: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个不要去掉。方法和数据的修饰符各自独立使用。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
39fc96e
into
OpenAtomFoundation:unstable
* delets kv slot * delete cmd slot * delete cache slot * delete slot command * delete pika_slot.cc/h * delete sharding code * delete slot * Add DB Shared_ptr in Cmd --------- Co-authored-by: wuxianrong <wuxianrong@360.cn>
* delets kv slot * delete cmd slot * delete cache slot * delete slot command * delete pika_slot.cc/h * delete sharding code * delete slot * Add DB Shared_ptr in Cmd --------- Co-authored-by: wuxianrong <wuxianrong@360.cn>
背景
在 v3.5.2 版本的 Pika 下,移除了 Sharding 模式,只有经典模式(Classics) 和集群模式(Codis + Pika),对于 Sharding 模式下残留的 Slot,我们需要进行删除,目前 Pika 下只有 DB 这个概念,一个 Pika 下有多个 DB(可配置),DB 目录下有五种数据结构类型的文件
代码改动
删除了
pika_slot.h
,pika_slot.cc
,pika_migrate_thread.h
,pika_migrate_thread.cc
这四个文件,对于主从复制模块,我们保留了 protobuf 中的 sloid_id 字段,兼容新旧 Pika 中做主从复制时需要用到的slot_id
值,如下:src/pika_repl_client.cc
我们把
pika_slot.h
和pika_slot.cc
中的代码迁移至pika_db.h
和pika_db.cc
中,并且把 Pika 中的 Sharding 模式代码以及 Rsync 代码进行了删除,让 Pika 的代码更加简洁易懂,同时我们进行了新旧版本 Pika 之间的主从测试(新主旧从,新从旧主),测试发现没有问题.fix:#2247