-
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
Pika一致性开发 #2944
Comments
Title: Pika consistency development |
目前的设计是没问题的,因为同 db(那肯定也包含同 key)的 binlog 会被分到相同的 worker 中,因为这个 worker 是 binlog worker,它只有一个 bg_thread 对任务进行取出和应用,所以不存在一致性的问题。调用顺序如下:
|
|
这里是写binlog的一致性的原因,key一致性的保证在PikaReplClient::ScheduleWriteDBTask的实现里面,取出redis_command的第一个操作对象作hash散列到write_db_workers_中,这样保证了写单key一定被同一个线程write_db_workers_执行,保证了一致性。 |
This comment was marked as resolved.
This comment was marked as resolved.
This will indeed be inconsistent. The current design does not consider the idempotence of such commands for the time being. This is an intermediate state. If you want this command to be consistent, you need to synchronize Applybinlog, which will cause too much performance loss. big |
同学你说的很对,非常细心,优秀! |
My classmate, you are right, very careful and excellent! |
看明白了,先写db,再写binlog。用SUnion取出values,然后再用SADD写入,这样发给从节点的binlog就是SDel+SAdd,在从节点就不有一致性问题了,谢谢。 |
I understand, write db first, then binlog. Use SUnion to take out the values, and then use SADD to write them. In this way, the binlog sent to the slave node is SDel+SAdd, and there will be no consistency problem on the slave node. Thank you. |
Which PikiwiDB functionalities are relevant/related to the feature request?
No response
Description
排期大概1个月,每周周会结束对一下进度
Proposed solution
问题记录:
Alternatives considered
###解决方案:
方案设计地址:
#2938
###开发分支
https://github.com/OpenAtomFoundation/pika/tree/consistency
The text was updated successfully, but these errors were encountered: