Skip to content

Commit

Permalink
Consolidate all server library code into one file and simplify a few …
Browse files Browse the repository at this point in the history
…things
  • Loading branch information
aw committed Jul 31, 2020
1 parent c79a6bd commit 6e293f1
Show file tree
Hide file tree
Showing 11 changed files with 544 additions and 550 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.15.0 (2020-07-31)

* Consolidate all server library code into one file: libkv.l
* Fix loading of module.l
* Simplify storage location and settings for temporary/lock files
* Explicitly make the child exit when it's finished processing

## 0.14.2 (2020-07-30)

* Ensure clients actually exit when a 'CLIENT KILL' command is received
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -364,7 +364,7 @@ Here we'll assume persistence was previously enabled and data has already been w
7. When a `BGSAVE` (non-blocking) command is received, a temporay copy of the AOF is made, the current AOF is wiped, and a background process is forked to save the DB to disk
8. When a `SAVE` (blocking) command is received, the in-memory DB is saved to disk and the AOF is wiped.
9. A backup of the DB file is always made before overwriting the current DB file.
10. To help handle concurrency and persistence, temporary files are named `.kv.db.lock`, `.kv.db.tmp`, `.kv.aof.lock`, and `.kv.aof.tmp`. It's best not to modify or delete those files while the server is running. They can be safely removed while the server is stopped.
10. To help handle concurrency and persistence, temporary files are named `kv.db.lock`, `kv.db.tmp`, `kv.aof.lock`, and `kv.aof.tmp`. It's best not to modify or delete those files while the server is running. They can be safely removed while the server is stopped.

## AOF format

Expand Down Expand Up @@ -394,7 +394,7 @@ When replaying the AOF, the server will ensure the hash of command and arguments

## DB format

The DB is stored by default in the `kv.db` file as defined by `*KV_db`. When backed up, it is named `.kv.db.old`.
The DB is stored by default in the `kv.db` file as defined by `*KV_db`. When backed up, the new filename contains the suffix `.old`.

Here are two separate entries in a typical DB:

Expand Down
54 changes: 0 additions & 54 deletions child.l

This file was deleted.

2 changes: 1 addition & 1 deletion client.l
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
(" SAVE" "^I^ISAVE")
(" SET key value" "^I^ISET mykey hello") ]

(chdir (car (file)) (load "libkvclient.l" "clihelpers.l"))
(chdir (car (file)) (load "libkvclient.l" "clihelpers.l" "module.l"))

# START
[ifn (argv)
Expand Down
198 changes: 0 additions & 198 deletions commands.l

This file was deleted.

Loading

0 comments on commit 6e293f1

Please sign in to comment.