From 543107a70eeffaa6932c87c02b43b0fd4f8558e5 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sun, 3 Jan 2021 13:09:35 +0200 Subject: feat: load chunk metadata into index at startup This needs to be replace with a database or something, but it'll do for now. --- obnam.md | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) (limited to 'obnam.md') 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 {"":{"sha256":"abc","generation":null,"ended":null}} +~~~ + +Can we still retrieve it by its identifier? + +~~~scenario +when I GET /chunks/ +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 -- cgit v1.2.1