restic/repository
Alexander Neumann 567de35df4 Save new packs in index atomically
This commit fixes a situation reported by a user where two indexes
contained information about the same pack without overlap, e.g.:

Index 3e6a32 contained:

    {
      "id": "c02e3b",
      "blobs": [
        {
          "id": "8114b1",
          "type": "data",
          "offset": 0,
          "length": 530107
        }
      ]
    }

And index 62da5f contained:

    {
      "id": "c02e3b",
      "blobs": [
        {
          "id": "e344f8",
          "type": "data",
          "offset": 1975848,
          "length": 3426468
        },
        {
          "id": "939ed9",
          "type": "data",
          "offset": 530107,
          "length": 1445741
        }
      ]
    }

This commit adds all blobs in a pack in one atomic operation so that
intermediate such as these do not happen.
2015-11-20 22:56:56 +01:00
..
testdata remove ConvertIndex 2015-11-08 22:27:13 +01:00
blob.go Use array instead of hash for backend.ID 2015-07-25 18:01:57 +02:00
config.go Use array instead of hash for backend.ID 2015-07-25 18:01:57 +02:00
config_test.go repository: Refactor Config 2015-07-05 11:07:10 +02:00
doc.go repository: fix package doc typo 2015-06-28 09:30:33 +02:00
index.go Save new packs in index atomically 2015-11-20 22:56:56 +01:00
index_test.go remove ConvertIndex 2015-11-08 22:27:13 +01:00
key.go Use array instead of hash for backend.ID 2015-07-25 18:01:57 +02:00
master_index.go Fix debug log message 2015-11-13 23:47:53 +01:00
parallel.go Small refactorings 2015-09-05 18:41:58 +02:00
parallel_test.go Allow cancelling parallel workers on files 2015-07-05 11:07:10 +02:00
pool.go Extract chunker 2015-07-08 16:58:23 -04:00
repository.go Save new packs in index atomically 2015-11-20 22:56:56 +01:00
repository_test.go Add benchmark for LoadJSONPack 2015-10-27 20:51:55 +01:00