Spdk/test
Maciej Szwed 622127d7e1 blobstore: Make possible to remove snapshot if there is only one clone
Starting with this patch it is possible to remove a
snapshot if there is only a one clone created from it.

In such case snapshot can be removed without any data
copying. This is achieved with following steps (case
with only one clone):
1. Open snapshot (Snapshot1) that shall be removed
2. Check if the Snapshot1 has no more than 1 clone (Clone1)
3. Remove Clone1 entry from Snapshot1
4. If the Snapshot1 has a parent snapshot (Snapshot2):
 4a. Add Clone1 entry to the Snapshot2 clones list
 4b. Remove Snapshot1 entry from Snapshot2 clones list
5. Open Clone1 blob
6. Freeze I/O operations on Clone1
7. Temporarily override md_ro flag for Snapshot1 and Clone1
   for MD modification
8. Merge Snapshot1 and Clone1 clusters maps into Clone1
   clusters map
9a. If Snapshot2 is present switch parent ID and backing
    bs_dev on Clone1
9b. If Snapshot2 is not present set parent ID to
    SPDK_BLOBID_INVALID and backing bs_dev to zeroes_dev
10. Sync MD on Clone1
11. Sync MD on Snapshot1
12. Restore MD flags for Clone1 and Snapshot1
13. Unfreeze I/O on Clone1
14. Close Clone1 blob
15. Remove Snapshot1

Signed-off-by: Maciej Szwed <maciej.szwed@intel.com>
Change-Id: I800724b981af894e01e1912d0077c5b34a2ae634
Reviewed-on: https://review.gerrithub.io/c/spdk/spdk/+/445576
Tested-by: SPDK CI Jenkins <sys_sgci@intel.com>
Reviewed-by: Tomasz Zawadzki <tomasz.zawadzki@intel.com>
Reviewed-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-by: Darek Stojaczyk <dariusz.stojaczyk@intel.com>
2019-06-18 13:19:32 +00:00
..
app util: add a new file operation API 2019-05-15 18:54:27 +00:00
bdev test/bdevio: respond with error via RPC on test failure 2019-06-18 03:40:50 +00:00
blobfs test: replace backticks with dollar-parenthesis syntax 2019-06-17 07:19:03 +00:00
blobstore test: replace backticks with dollar-parenthesis syntax 2019-06-17 07:19:03 +00:00
common vm_setup: fix scan-build not found on ubuntu18 2019-06-18 12:55:25 +00:00
config_converter iscsi: Deprecate MinConnectionsPerCore 2019-05-06 17:10:48 +00:00
cpp_headers Makefile: Add possibility to uninstall spdk. 2019-05-16 20:56:18 +00:00
env test: replace backticks with dollar-parenthesis syntax 2019-06-17 07:19:03 +00:00
event notify: add notification library 2019-03-29 21:15:14 +00:00
ftl test/fio: export single variable for running fio_plugins 2019-06-06 05:17:16 +00:00
ioat examples: rename ioat perf tool to ioat_perf 2019-05-22 14:51:01 +00:00
iscsi_tgt test/iscsi: add iso option to rpc_config test 2019-06-17 07:51:52 +00:00
json_config test/json: cover get_notification_types RPC 2019-06-17 10:08:39 +00:00
lvol blobstore: Make possible to remove snapshot if there is only one clone 2019-06-18 13:19:32 +00:00
nvme test/asan: preload ASAN for fio 2019-06-18 03:40:50 +00:00
nvmf test/asan: preload ASAN for fio 2019-06-18 03:40:50 +00:00
ocf test/ocf: disable persistent metadata test 2019-06-11 18:16:55 +00:00
pmem bdev: remove delete_bdev RPC 2019-03-01 08:50:07 +00:00
rpc_client rpc: rename RPC get_rpc_methods to rpc_get_methods 2019-05-27 12:52:53 +00:00
spdkcli spdkcli: Add support for raid devices 2019-05-09 19:36:35 +00:00
unit blobstore: Make possible to remove snapshot if there is only one clone 2019-06-18 13:19:32 +00:00
vhost test/vhost: Fix. Do not remove results dir if it is needed. 2019-06-17 07:51:48 +00:00
Makefile jsonrpc-client: add new C client library 2018-10-11 20:07:44 +00:00
spdk_cunit.h test: remove leftover spdk_cunit declaration 2018-07-06 22:47:56 +00:00