summaryrefslogtreecommitdiff
path: root/obnam.md
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2021-01-03 13:09:35 +0200
committerLars Wirzenius <liw@liw.fi>2021-01-03 13:53:43 +0200
commit543107a70eeffaa6932c87c02b43b0fd4f8558e5 (patch)
tree2cfb0b9e4dd69f93413d0e934e1113534d7352dc /obnam.md
parente6a4eb6edf83a68a6f73094126804beb0c569937 (diff)
downloadobnam2-543107a70eeffaa6932c87c02b43b0fd4f8558e5.tar.gz
feat: load chunk metadata into index at startup
This needs to be replace with a database or something, but it'll do for now.
Diffstat (limited to 'obnam.md')
-rw-r--r--obnam.md43
1 files changed, 43 insertions, 0 deletions
diff --git a/obnam.md b/obnam.md
index e877e4c..7fa902f 100644
--- a/obnam.md
+++ b/obnam.md
@@ -777,6 +777,49 @@ then HTTP status code is 404
~~~
+## Persistent across restarts
+
+Chunk storage, and the index of chunk metadata for searches, needs to
+be persistent across restarts. This scenario verifies it is so.
+
+First, create a chunk.
+
+~~~scenario
+given an installed obnam
+and a running chunk server
+and a file data.dat containing some random data
+when I POST data.dat to /chunks, with chunk-meta: {"sha256":"abc"}
+then HTTP status code is 201
+and content-type is application/json
+and the JSON body has a field chunk_id, henceforth ID
+~~~
+
+Then, restart the server.
+
+~~~scenario
+when the chunk server is stopped
+given a running chunk server
+~~~
+
+Can we still find it by its metadata?
+
+~~~scenario
+when I GET /chunks?sha256=abc
+then HTTP status code is 200
+and content-type is application/json
+and the JSON body matches {"<ID>":{"sha256":"abc","generation":null,"ended":null}}
+~~~
+
+Can we still retrieve it by its identifier?
+
+~~~scenario
+when I GET /chunks/<ID>
+then HTTP status code is 200
+and content-type is application/octet-stream
+and chunk-meta is {"sha256":"abc","generation":null,"ended":null}
+and the body matches file data.dat
+~~~
+
# Acceptance criteria for Obnam as a whole
The scenarios in this chapter apply to Obnam as a whole: the client