Open hackerwins opened 1 year ago
The options that you've suggested look good to me. I have listed some of the considerations for these options below.
These options seem like opposite options to me, but I think they both can be implemented by using etcd. I'll keep searching for more information on these options.
I have implemented leader election with K8s lease object, but this will make yorkie k8s dependent.
Therefore, I will change this implementation with MongoDB, where yorkie already have dependency on.
To be specific about the implementation, I will use the way of nodes try to update on the same document(same _id
) by checking lease_expire_at
field.
Also, to ensure that only one node becomes the leader when a lease has expired, I will use TTL indexes to remove document on expiry, preventing nodes to update the same document simultaneously.
@hackerwins Are we proceeding this issue?
No, it's still on hold. During housekeeping, it seems that Client Deactivation competing across nodes doesn't cause significant issues, so we haven't proceeded with this.
What would you like to be added:
We recently introduced cluster mode based on the shard key. This shard key is used to assign APIs requested by clients to servers in the cluster based on project or document.
Housekeeping operations should also apply this sharded cluster structure. We can think of two options:
Why is this needed: