storage: Avoid writing the whole device in coalesce tests#449
Conversation
|
I'd suggest writing data based on the translation unit of the virtual disk (e.g. if LVM stripe size is 4MB, write a small block every 3.99 MB). This will test writes to many suboffsets of the translation unit, and also test the whole range of the virtual disk at the same time. However, I imagine each backend/format combination will have a different translation unit requirement |
| # default seed is 0 | ||
| randstream(vm, f'validate --expected-checksum {checksum} {dev}') | ||
| # generate at the start, in the middle and the end of the disk | ||
| checksum1 = randstream(vm, f'generate --size {stream_size} {dev}') |
There was a problem hiding this comment.
It might be good to have a helper to generate and validate data. You could give it a list of place to write and it could return a list of checksum that you can give to the validate one. It would simplify coalesce_integrity which is becoming big.
There was a problem hiding this comment.
That's kind of what I did in the next commit (the list of places is hardcoded), to reuse those functions in other tests. I'm moving that commit in this PR.
3b66c5b to
ca168c5
Compare
f856a46 to
74095e0
Compare
74095e0 to
23c00cb
Compare
a58140c to
9e09978
Compare
23c00cb to
029b878
Compare
029b878 to
82d41a2
Compare
28a8042 to
9cd481c
Compare
82d41a2 to
81f8cee
Compare
9cd481c to
63d6054
Compare
24edbe5 to
bb496a2
Compare
0599c79 to
c594a03
Compare
0028ba7 to
8dbcdb1
Compare
8dbcdb1 to
769890c
Compare
c594a03 to
3ef0c7f
Compare
769890c to
db0349e
Compare
9988aaf to
5ed2bbc
Compare
db0349e to
13a2c24
Compare
5ed2bbc to
6024db3
Compare
13a2c24 to
8863a2a
Compare
| # generate at the start, in the middle and the end of the disk | ||
| # use seeds unlikely to collide with other usages | ||
| checksum1 = randstream(vm, f'generate --seed 10 --size {size} {dev_path}') | ||
| checksum2 = randstream(vm, f'generate --seed 11 --position {dev_size // 2} --size {size} {dev_path}') |
There was a problem hiding this comment.
The write size can be as big as 2 GiB, this might not work on smaller VDIs especially if writes overlap. Although it'll just need a note.
6024db3 to
94b427a
Compare
8863a2a to
43f0058
Compare
This is necessary with large volumes to run in a reasonable amount of time on standard hardware. This is done by: * writing in only a small piece of data at the beginning, in the middle and at the end of the device * creating the snapshot/clone * writing for data in an already used location and a non used one * triggering the coalesce * finally verifying that the data we generated is accessible as expected Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
Extract reusable functions for partially populating and validating disk contents to reduce code duplication in storage tests. Signed-off-by: Gaëtan Lehmann <gaetan.lehmann@vates.tech>
94b427a to
accd1d0
Compare
This is done by:
and at the end of the device
Still not necessarily clear to me:
This PR is part of a tree containing 19 PRs:
mastermaster