diff options
author | Lars Wirzenius <liw@liw.fi> | 2021-01-03 13:09:35 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2021-01-03 13:53:43 +0200 |
commit | 543107a70eeffaa6932c87c02b43b0fd4f8558e5 (patch) | |
tree | 2cfb0b9e4dd69f93413d0e934e1113534d7352dc /obnam.md | |
parent | e6a4eb6edf83a68a6f73094126804beb0c569937 (diff) | |
download | obnam2-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.md | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -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 |