Commit 7f56e8e
committed
kvm: do not let a failed flush or a failed snapshot removal report success
Closing an RBD image is where librbd flushes, so a close that fails on an image
just written is the last chance a lost write has to surface. Routing those two
closes through the non-throwing helper turned that into a warning and returned
the disk anyway, which would register a volume whose tail writes never landed.
Close the written destination explicitly and let it fail the copy; the finally
still covers the paths that did not get that far.
deleteSnapshot had the same shape: a failed snapUnprotect or snapRemove was
logged and the method still answered "removed successfully", dropping the record
while the snapshot kept pinning space on the cluster, and one left protected also
blocks removal of its parent volume. It now fails, except for ENOENT, where the
snapshot is already gone and the delete has nothing left to do. The same ENOENT
tolerance keeps the RBD branch of ManageSnapshotCommand idempotent for deletes.
Also corrects the applyTimeouts javadoc, which said 0 means waiting forever for
all three options; that is true of the two operation timeouts but the connect
timeout falls back to the librados default of 300s. The snapshot test now pins
the unwind order, since destroying an IO context after its cluster handle has
been shut down would be a use after free.
Signed-off-by: Brad House <bhouse@nexthop.ai>1 parent 5759f20 commit 7f56e8e
7 files changed
Lines changed: 65 additions & 13 deletions
File tree
- agent/src/main/java/com/cloud/agent/properties
- plugins/hypervisors/kvm/src
- main/java/com/cloud/hypervisor/kvm
- resource/wrapper
- storage
- test/java/com/cloud/hypervisor/kvm/storage
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
942 | 942 | | |
943 | 943 | | |
944 | 944 | | |
945 | | - | |
946 | 945 | | |
947 | 946 | | |
948 | 947 | | |
| |||
Lines changed: 18 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | 37 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| 53 | + | |
| 54 | + | |
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| |||
132 | 135 | | |
133 | 136 | | |
134 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
135 | 153 | | |
136 | | - | |
137 | | - | |
138 | | - | |
139 | | - | |
140 | 154 | | |
141 | 155 | | |
142 | 156 | | |
| |||
Lines changed: 0 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
65 | | - | |
66 | 65 | | |
67 | 66 | | |
68 | 67 | | |
| |||
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
| 48 | + | |
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| |||
106 | 106 | | |
107 | 107 | | |
108 | 108 | | |
109 | | - | |
| 109 | + | |
| 110 | + | |
110 | 111 | | |
111 | 112 | | |
112 | 113 | | |
| |||
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
175 | 178 | | |
176 | 179 | | |
177 | 180 | | |
| |||
2948 | 2951 | | |
2949 | 2952 | | |
2950 | 2953 | | |
2951 | | - | |
2952 | | - | |
| 2954 | + | |
| 2955 | + | |
| 2956 | + | |
| 2957 | + | |
| 2958 | + | |
| 2959 | + | |
| 2960 | + | |
| 2961 | + | |
| 2962 | + | |
| 2963 | + | |
| 2964 | + | |
| 2965 | + | |
| 2966 | + | |
| 2967 | + | |
| 2968 | + | |
| 2969 | + | |
2953 | 2970 | | |
2954 | 2971 | | |
2955 | 2972 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1420 | 1420 | | |
1421 | 1421 | | |
1422 | 1422 | | |
| 1423 | + | |
| 1424 | + | |
| 1425 | + | |
| 1426 | + | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
1423 | 1431 | | |
1424 | 1432 | | |
1425 | 1433 | | |
| |||
1517 | 1525 | | |
1518 | 1526 | | |
1519 | 1527 | | |
| 1528 | + | |
| 1529 | + | |
| 1530 | + | |
| 1531 | + | |
| 1532 | + | |
| 1533 | + | |
| 1534 | + | |
1520 | 1535 | | |
1521 | 1536 | | |
1522 | 1537 | | |
| |||
Lines changed: 10 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
50 | 50 | | |
51 | 51 | | |
52 | 52 | | |
| 53 | + | |
53 | 54 | | |
54 | 55 | | |
55 | 56 | | |
| |||
549 | 550 | | |
550 | 551 | | |
551 | 552 | | |
552 | | - | |
553 | | - | |
554 | | - | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
555 | 562 | | |
556 | 563 | | |
557 | 564 | | |
| |||
0 commit comments