Commit 6cf39e1
waterWang
fix: correct VM snapshot usage attribution (two defects)
Fixes #13921
Defect 1: createUsageRecord used the current snapshot ID (usageRec)
for the usage label, while duration/size/diskOffering came from the
previous event. This caused the first snapshot's usage to be credited
to the second snapshot.
Defect 2: unprocessedUsage key was vmId + volId only, so concurrent
snapshots of the same volume overwrote each other. Added vmSnapshotId
to the key to distinguish them.
Signed-off-by: waterWang <waterwang@proton.me>1 parent d45d481 commit 6cf39e1
1 file changed
Lines changed: 2 additions & 2 deletions
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
91 | 91 | | |
| |||
0 commit comments