Comments (2)
The options that you've suggested look good to me.
I have listed some of the considerations for these options below.
- Only the master server executes housekeeping in the cluster.
- Implementation: Using etcd with the raft leader election algorithm will ease this implementation. We can use K8s go client leader election package with etcd for this operation:
- Pros: It looks easy to implement.
- Cons: As workload for housekeeping increases, housekeeping overhead on the master server will increase, which may lead to server panic or failure.
- Split housekeeping tasks per project and execute them on servers mapped by project.
- Implementation: We need to map the server with the project range to housekeeping in etcd and pull this information before housekeeping. Maybe we can reference Yorkie's etcd implementation in the sync package for this task
- Yorkie sync package's Membership: https://github.com/yorkie-team/yorkie/blob/3022eecebad070db32d06ba3c762d54875743dc4/server/backend/sync/etcd/membermap.go
- Pros: We can distribute housekeeping workload just like document workload sharding, which will ease the overhead of servers to handle housekeeping.
- Cons: Implementation seems to be more difficult than the first option.
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.
from yorkie.
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.
from yorkie.
Related Issues (20)
- Use clientKey instead of clientID for client information
- Handle presence updates before attaching a document
- Preserve users' intentions during concurrent rich-text editing (refer to Peritext)
- Introduce sharding rules to MongoDB collections
- Document doesn't converge when using `Array.MoveAfter`
- Add API for Retrieving All Documents HOT 8
- `getGarbageLen()` does not match the actual number of elements for garbage collection HOT 5
- Support Undo/Redo for Array.Add and Array.Remove
- Tree.Style
- Suggestion for support flutter
- Housekeeping structure improvement HOT 3
- Incorrect Garbage Collection Due to MinSyncedSeq Determination with Lamport Clocks
- Incorrect TreeChange Generation in Concurrent Editing HOT 1
- After migrating gRPC to connect-rpc, CLI doesn't work with `api.yorkie.dev:443`
- Housekeeping is Not Working Properly on Single Project HOT 5
- Support concurrent merge and split operations in Tree
- Refine test codes in Tree to clearly describe feature specification
- ErrDocumentIfNotAttached occurs when trying to remove documents in Dashboard HOT 1
- When generate NewRoot from snapshot, GC doesn't work properly on tree and text.
- Refactor the counter with generics
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from yorkie.