make a flakey device
Hi Joe,
I tried to add new test having following scenario:
- create a wb device with devices carved out from tvm
- grab ruby, extract and configure it on it.
- remove the device
- recreate the wb device
- wrap one of the underlying devices by flakey with random (up, down)
- compile ruby
- fails at some moment
- remove the device
- repeat from 4
this test is to see wb device can terminate itself after IO error without failure no matter where the IO error occured.
However, I couldn't make at the step 5. The problem is that the device to wrap is carved out from tvm and thus hides its implementation except its a linear device. All we need to know to make a wrapped device in step 5 is that the offset and the name of underlying device of the device.
For example, in thin-provisioning/pool_resize_tests.rb you makes a flakey device but you are using @metadata_dev not the metadata variable knowing that the metadata is starting from LBA 0 of the @metadata_dev.
This is not a good code because it depends on the implicit information. Actually, it should be able to write this code like this
table = Table.new(FlakeyTarget.new(dev_size(metadata.dev), metadata.dev, metadata.start, up_interval, 60))
where metadata.dev is the device under metadata.
There seems a workaround by parsing the table of the linear device to get the (dev, sector). Should I work this way?
Please advice me if you have time. I have four consecutive holidays and thus can do some works. I will try to write two tests (this is the one and the other is to test a unlikely cache-hit path).
On 21 April 2014 00:14, Akira Hayakawa [email protected] wrote:
For example, in thin-provisioning/pool_resize_tests.rb you makes a flakey device but you are using @metadata_dev not the metadata variable knowing that the metadata is starting from LBA 0 of the @metadata_dev.
I'm not really sure what the problem is here. You can wrap one of the linear devices with a flakey device in exactly the same way as I did with the @metadata_dev. There's no need for an offset unless you want to make a specific sub region of the linear device flakey; in which case use another tvm to carve up the linear.
- Joe