-
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
d95f9a3
to
f68d68e
Compare
f68d68e
to
0300dac
Compare
1d0815a
to
9762021
Compare
9762021
to
93d9d7d
Compare
b2af3e3
to
e8c14c7
Compare
cc41729
to
c00e32f
Compare
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
c00e32f
to
3475146
Compare
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
3475146
to
ab7078e
Compare
ab7078e
to
9deed6a
Compare
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