Commit Graph

554 Commits

Author SHA1 Message Date
Kelvin Clement Mwinuka
ce0eabf865 GetState receiver function now checks wether there's an active copy or state mutation before proceeding with the copy.
Handling of write commands is delayed until state copy is complete.
2024-01-31 01:55:51 +08:00
Kelvin Clement Mwinuka
25b2cb7154 Implemented RewriteLog functionality and defined handler for REWRITE AOF command. 2024-01-30 23:33:24 +08:00
Kelvin Clement Mwinuka
dff80940cd Changed bgsave command to save and bgrewriteaof to rewriteaof because these functions will only be ran concurrently and never on the main thread.
Implented AOF command logging in AOFEngine which creates a new log file if one does not exist and append to the file if one is found.
2024-01-30 21:16:37 +08:00
Kelvin Clement Mwinuka
0a0be8e978 Implemented periodic snapshot in standalone mode based on threshold and interval 2024-01-29 11:57:44 +08:00
Kelvin Clement Mwinuka
01a8db2fe0 Added log statement for restoring snapshot 2024-01-29 00:23:42 +08:00
Kelvin Clement Mwinuka
a081971427 Implemented restore function in standalone snapshot engine 2024-01-29 00:22:47 +08:00
Kelvin Clement Mwinuka
d31acfbbdd Updated Raft snapshot to also persist last saved unix timestamp in milliseconds. This timestamp is re-loaded when the server is re-started.
Created standalone snapshot flow including manifest file that is used to determine whether another snapshot should be taken based on the hashed contents of the snapshot.
2024-01-28 03:36:09 +08:00
Kelvin Clement Mwinuka
06822f122f Removed 5 second wait in snapshot persistence method 2024-01-27 01:47:58 +08:00
Kelvin Clement Mwinuka
7e59de20a2 Implement checking wether snapshot is in progress before continuing 2024-01-27 01:46:16 +08:00
Kelvin Clement Mwinuka
4895b109b8 Sync snapshot command across cluster 2024-01-26 22:10:29 +08:00
Kelvin Clement Mwinuka
3c5d6fef2c Created basic handling for taking snapshots. Will implemented error when snapshot in progress and propagation of snapshot command to the rest of the cluster 2024-01-26 00:58:43 +08:00
Kelvin Clement Mwinuka
63fcb490c9 Created admin commands module. Added bgsave command without implementation. 2024-01-25 23:11:09 +08:00
Kelvin Clement Mwinuka
97f0f142a6 Added configuration options for snapshot threshold and snapshot interval 2024-01-25 18:59:04 +08:00
Kelvin Clement Mwinuka
bdebdea7ad Added snapshot interval value to raft configuration 2024-01-25 18:04:02 +08:00
Kelvin Clement Mwinuka
4e12064ce8 Implemented snapshot persistence on raft layer 2024-01-25 17:52:22 +08:00
Kelvin Clement Mwinuka
1c00706f88 Updated module name to echovault 2024-01-24 22:32:05 +08:00
Kelvin Clement Mwinuka
bb2d44fe39 Updated ReadMessage function in utils 2024-01-24 20:18:47 +08:00
Kelvin Clement Mwinuka
7e55fd469b Code formatting: declare writer and reader on the same line 2024-01-23 23:58:09 +08:00
Kelvin Clement Mwinuka
4b980cc5fd Remvoved response skipping for +ack message from client. 2024-01-23 23:54:39 +08:00
Kelvin Clement Mwinuka
ce14f59f41 Replaced all instances of utils.Contains with slices.Contains.
Deleted Contains function from the utils.go file.
Replaced bufio.ReadWriter with io.Reader and io.Writer respectively.
Updated PubSub module to remove posibility of not passing a channel name when subscribing or publishing.
2024-01-23 23:38:07 +08:00
Kelvin Clement Mwinuka
490bddf80c Moved aof and snapshot packages into server directory. 2024-01-22 17:43:28 +08:00
Kelvin Clement Mwinuka
9017f12fa9 Removed http options flag as it will not be used for now.
Moved server cluster receiver functions into cluster.go.
Moved keyspace receiver functions into keyspace.go.
Moved module and command loading into modules.go.
Updated Dockerfile and docker-compose to remove http flag to server.
2024-01-22 17:38:44 +08:00
Kelvin Clement Mwinuka
78aa9a82c6 Renamed memebrlist_layer directory to memberlist.
Renamed raft_layer directory to raft.
Created snapshot and aof packages to handle snapshots in standalone mode and aof package to handle append-only function.
Created server package that will contain the server logic.
2024-01-21 15:03:36 +08:00
Kelvin Clement Mwinuka
12c78a4a5a Added feature roadmap entries to README.md 2024-01-20 15:01:07 +08:00
Kelvin Clement Mwinuka
2e0160b117 Implemented mutation propagation from follower node to leader node 2024-01-20 10:17:31 +08:00
Kelvin Clement Mwinuka
a8fde28a1a Extracted raft apply function to its own method for reusability 2024-01-20 09:10:02 +08:00
Kelvin Clement Mwinuka
2c71191e5a ForwardDataMutation method accepts connectionID. This will be passed to the raft.Apply method 2024-01-19 19:14:52 +08:00
Kelvin Clement Mwinuka
1ac941151f Refactored broadcast for joining raft cluster. Instead of broadcasting repeatedly with a ticker, the message will be relayed using gossip protocol until it reaches the raft leader.
Created scaffolding for forwarding mutation commands from replica nodes to leader node.
2024-01-19 16:40:55 +08:00
Kelvin Clement Mwinuka
c82560294d Refactored memberlist and raft layers into their own packages 2024-01-10 02:37:48 +03:00
Kelvin Clement Mwinuka
1f91ac1ac9 Removed FetchData from msg.Action in memberlist notify. This is because pure fetch commands can be carried out on any node without involving the leader or any other cluster members. MutateData has been left in the code for the purpose of propagating changes from a follower to a leader in the future. 2024-01-09 20:38:05 +03:00
Kelvin Clement Mwinuka
f0a9a69040 Comment refactoring in memberlist.go 2024-01-09 20:32:30 +03:00
Kelvin Clement Mwinuka
a8b47d7fda Created test skeleton for ping commands 2024-01-08 22:08:53 +03:00
Kelvin Clement Mwinuka
52afde3253 Update README.md 2024-01-08 20:31:35 +03:00
Kelvin Clement Mwinuka
eb00492037 Refactor 2024-01-07 00:00:30 +03:00
Kelvin Clement Mwinuka
a3c7298b4c Removed IncludedKeys property on user. Keys that are included in both read and write keys will be considered RW 2024-01-06 22:48:38 +03:00
Kelvin Clement Mwinuka
b781a8025c Set up check for nokeys 2024-01-06 21:40:58 +03:00
Kelvin Clement Mwinuka
db344c9469 Reset NoKeys when keys are added 2024-01-06 21:29:53 +03:00
Kelvin Clement Mwinuka
5668b759e5 Pre-compile globs for matching during authorization in acl 2024-01-06 20:58:26 +03:00
Kelvin Clement Mwinuka
90782ea5ff Added glob pattern matching in acl with the gobwas/glob package 2024-01-06 19:34:13 +03:00
Kelvin Clement Mwinuka
86fcfad007 Replaces utils.Contains with slices.Contains in modules/acl/user.go 2024-01-06 18:44:03 +03:00
Kelvin Clement Mwinuka
ecf3fb9685 Implemented built in slice utility function to enhance the acl authorization flow 2024-01-05 23:20:21 +03:00
Kelvin Clement Mwinuka
4fc70d2f35 Updated HGET to return correct encoding for nil response 2024-01-05 19:43:43 +03:00
Kelvin Clement Mwinuka
db3991a89d Removed 'Bitfield support' from feature roadmap README.md as it's part of Bitmap support 2024-01-05 00:14:30 +03:00
Kelvin Clement Mwinuka
53542a3f83 Updated README.md file included features 2024-01-04 19:48:31 +03:00
Kelvin Clement Mwinuka
d460116d9f Implemented INCRBY and INCRBYFLOAT commands 2024-01-04 19:31:47 +03:00
Kelvin Clement Mwinuka
1520b214ab Implemented HRANDFIELD command 2024-01-04 18:43:04 +03:00
Kelvin Clement Mwinuka
5e6f2386df Implemented HDEL command 2024-01-04 17:43:49 +03:00
Kelvin Clement Mwinuka
eefc032ba2 Implemented HEXISTS command 2024-01-04 17:27:22 +03:00
Kelvin Clement Mwinuka
a5f94deb22 Implemented HGETALL command 2024-01-04 17:14:20 +03:00
Kelvin Clement Mwinuka
1229538379 Implemented HKEYS command 2024-01-04 16:59:40 +03:00