Commit Graph

47 Commits

Author SHA1 Message Date
Kelvin Mwinuka
93a165e9f9 Added support for HELLO command.
Load modules build from Dockerfile.dev into instances from docker-compose.yml.
Fixed user loading from config file in ACL module.
2024-07-01 06:05:07 +08:00
Kelvin Mwinuka
9b0d590171 Removed RaftBindPort config. Raft bind address and port are dynamically assigned on startup instead of configured manually. Replaced memberlist-port configuration with discovery-port. 2024-06-20 04:20:31 +08:00
Kelvin Clement Mwinuka
33d6651928 Removed --in-memory config flag. InMemory is now inferred from whether the data directory was provided. 2024-06-13 16:37:30 +08:00
Kelvin Clement Mwinuka
f894a531b0 Added happy path test case for data replication 2024-05-22 16:11:00 +08:00
Kelvin Clement Mwinuka
a9c11adcd6 Fixed users unlock in ACL LOAD command handler 2024-05-19 04:28:06 +08:00
Kelvin Clement Mwinuka
0f6ae1c8ac Implemented LoadModules method to load external modules at runtime.
Implemented UnloadModules method to remove modules at runtime.
Implemented ListModules method to list the current loaded modules.
Implemented "MODULE LOAD", "MODULE UNLOAD", and "MODULE LIST" commands.
2024-05-03 11:57:21 +08:00
Kelvin Clement Mwinuka
000115ceb0 Created "loadmodules" args for loading ".so" modules into EchoVault.
Moved types associated with embedded commands extension into api_admin.go file and deleted types.go file as it's no longer necessary.
Updated docker-compose and Dockerfile.dev to pass .so modules to load on startup.
Volumes folder is no longer ignores except for the nodes subfolder.
2024-04-30 12:17:30 +08:00
Kelvin Clement Mwinuka
2291ba4f31 Implemented ADD_COMMAND method to add a custom command to echovault 2024-04-27 06:42:57 +08:00
Kelvin Mwinuka
389c871781 Start raft and memberlist layers in NewEchoVault. Return error fron NewEchoVault function when TLS config does not match certificate options provided 2024-04-01 23:24:22 +08:00
Kelvin Mwinuka
c56e749167 Implemented outward-facing API for Pub/Sub module 2024-03-30 02:30:37 +08:00
Kelvin Mwinuka
0a70104d78 Created api_ files in echovault subfolder that will allow us to export easyily usable APIs for embedding Go code 2024-03-27 14:25:34 +08:00
Kelvin Mwinuka
88a8e2aae6 Created DefaultConfig to be used when embedding echovaule. Moved ACL and PubSub to internal packages with only the associated commands in the modules folder. Initialise ACL and PubSub when creating new EchoVault instance which removed the need to pass WithACL and WithPubSub options. 2024-03-26 18:15:27 +08:00
Kelvin Mwinuka
ba2ebaa6da Renamed 'server' package to 'echovault' 2024-03-25 16:26:09 +08:00
Kelvin Mwinuka
90ed2d44b4 Removed KEY and CERT environment variables for all cluster nodes in docker compose file.
broadcastRaftAddress function in memberlist package no longer requires a context to be passed to it.
Moved FilterExpiredKeys function to utils package as it's shared by aof engine, snapshot engine, and raft snapshot store.
2024-03-12 23:10:45 +08:00
Kelvin Mwinuka
52646d1564 Take expiry into account when creating snashot and AOF preamble. If the key is already expired when snapshot is taken, it will not be persisted. If the key is expired when loading a snapshot/preamble, it will not be restored. 2024-03-12 21:35:39 +08:00
Kelvin Mwinuka
f27a0dda79 Implemented eviction algorithm that samples a configurable number of keys with TTLs (default 20) at a configurable interval (default 100ms) and deletes the keys that are expired. 2024-03-12 02:12:55 +08:00
Kelvin Mwinuka
52b39d5b0f Re-enabled cluster nodes in docker-compose.yml.
Created flow to forward key deletion command from non-leader node to leader node.
Created flow for propagating key deletion accross the entire cluster to maintain consistency of the deleted keys.
2024-03-11 20:39:57 +08:00
Kelvin Mwinuka
c414da16b4 KeyExists keyspace function now removes the key if the key expiry is in the past.
KeyData type moved to utils package to allow sharing between multiple packages.
Updated all commands and command tests to pass context object to KeyExists, KeyLock, keyUnlock, KeyRLock, and KeyRUnlock.
Create context object for each test in all test suites instead of just passing context.Background() to all functions that accept a context.
2024-03-10 23:19:05 +08:00
Kelvin Mwinuka
0b90c9343e Added DEL command for deleting keys from the store 2024-03-08 22:49:03 +08:00
Kelvin Clement Mwinuka
5c347cb7de Changed max-memory to uint64. Added TODO commends on how to handle memory checking for key eviction. 2024-03-05 22:45:05 +08:00
Kelvin Clement Mwinuka
28f97656c4 Removed etc and get modules and replaced them with generic module. Implemented functions to set and remove the expiry of a key. Implemented LRU and LFU caches using heap. 2024-03-03 16:21:12 +08:00
Kelvin Clement Mwinuka
e569bf6837 Added config flags max-memory and eviction-policy to manage memory usage. Created ParseMemory utility function to parse max-memory value into bytes. Created LFU cache to be used with heap data structure for managing LFU cache. 2024-03-01 16:25:04 +08:00
Kelvin Clement Mwinuka
97b41da729 Moved aof and snapshot packages from server folder to src folder. Created new package for evictions 2024-02-29 16:06:52 +08:00
Kelvin Clement Mwinuka
facdc089d8 Implemented command handler for COMMAND LIST command 2024-02-28 15:16:11 +08:00
Kelvin Clement Mwinuka
1a4747db6d Updated GPL badge to v3 and uncommented cluster nodes in docker-compose.yml 2024-02-28 13:35:02 +08:00
Kelvin Clement Mwinuka
160c701c3a MGET command now returns RESP nil value for non-existent keys 2024-02-27 16:07:13 +08:00
Kelvin Clement Mwinuka
088e4c25f0 Made GET, MGET, SET, MSET, SETNX commands compatible with redis client 2024-02-27 15:41:22 +08:00
Kelvin Clement Mwinuka
fbb0b8dc8d Removed plugin-dir cli flag as its not used 2024-02-26 00:37:00 +08:00
Kelvin Clement Mwinuka
5e1e362b28 Updated flags from camelCase to kebab-case 2024-02-25 23:27:57 +08:00
Kelvin Clement Mwinuka
02351a3374 Re-enabled cluster instances in docker-compose 2024-02-25 22:00:07 +08:00
Kelvin Clement Mwinuka
8d7fe0225a Created AppendReadWriter and PreambleReadWriter interfaces for file handling in the log and preamble packages respectively.
Seek to the beginning of the preamble file after truncating.
2024-02-25 15:16:27 +08:00
Kelvin Clement Mwinuka
b0375f2ef1 Renamed dev dockerfile to 'Dockerfile.dev' 2024-02-23 05:05:57 +08:00
Kelvin Clement Mwinuka
c8a2700ab1 Remvoed CGO_ENABLED env var on go build command in makefile 2024-02-23 05:03:16 +08:00
Kelvin Clement Mwinuka
5bb5d5428b Updated docker-compose to include MTLS, CERT_KEY_PAIR and CLIENT_CA for cluster nodes. Uncommented cluster nodes 2024-02-11 16:35:50 +08:00
Kelvin Clement Mwinuka
69c9170f56 Implemented mTLS listener to verify client certificates. 2024-02-03 06:40:03 +08:00
Kelvin Clement Mwinuka
3cd9da245c Untrack docker-compose.yaml and Dockerfile 2023-09-10 02:17:39 +08:00
Kelvin Clement Mwinuka
01712892de Set default dataDir config. Set INMEMORY env var of docker containers to false. Added volumes folder to gitignore 2023-09-05 01:14:55 +08:00
Kelvin Clement Mwinuka
5fa6bc893c Re-enabled all the nodes in docker-compose 2023-08-12 05:56:33 +08:00
Kelvin Clement Mwinuka
c101b18969 Created ApplyRequest and ApplyResponse types to handle calls and responses to raft.Apply.
In-Memory state between nodes is now synchronized.
2023-08-12 05:40:35 +08:00
Kelvin Clement Mwinuka
bc4ce05753 User proper boolean value passing in Dockerfile CMD command.
Pass key, cert and set TLS env variable to true in docker-compose file to enable tls mode.
2023-08-12 00:53:08 +08:00
Kelvin Clement Mwinuka
e8df5bb13c Updated Makefile to build for linux/amd64 2023-08-10 04:52:16 +08:00
Kelvin Clement Mwinuka
de1f9681a2 Installed boltdb for logstore and stablestore 2023-08-08 23:26:14 +08:00
Kelvin Clement Mwinuka
e1e89f46ca Implement raft and memberlist shutdown 2023-08-01 01:17:37 +08:00
Kelvin Clement Mwinuka
d82a6a98d7 Use UDP dial to find default address for outbound traffic.
Set default bindAddr if it has not been explicitly provided be the user.
2023-07-29 01:33:33 +08:00
Kelvin Clement Mwinuka
52eaa6b735 Added 2 nodes in docker-compose for cluster testing 2023-07-23 02:56:54 +08:00
Kelvin Clement Mwinuka
dc5ff9855d Pass server args in docker-compose 2023-07-22 06:30:14 +08:00
Kelvin Clement Mwinuka
d4a5997b30 Scrapped plugin design in favour of simple command interfaces.
Setup docker build process for running server.
Deleted test files.
2023-07-22 05:34:07 +08:00