Commit Graph

314 Commits

Author SHA1 Message Date
Robert Baldyga
d5b2c65a39 Remove "metadata_layout" parameter of the cache
This feature is replaced with LRU list shuffling.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-03-07 17:48:25 +01:00
Robert Baldyga
73f3b73f0f
Merge pull request #663 from pdebski21/1023_xfail
Test for load with changed core size
2022-03-02 21:03:00 +01:00
Robert Baldyga
765d1c5d77 rio: fix size comparison in
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-02-24 15:02:46 +01:00
Jan Musial
cd0551e72e Use rio in promotion policy tests
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 14:56:09 +01:00
Adam Rutkowski
a6d8bd0470 rio: accept queue list in Rio constructor
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 14:56:09 +01:00
Adam Rutkowski
372b1f1e1c remove unnecessary callback decorator in rio
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-02-24 14:56:09 +01:00
Adam Rutkowski
9baf9a3876 rio: convert Size to bytes for extent calculation
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-02-24 14:56:09 +01:00
Jan Musial
9360e55851 Update basic pyOCF tests to use rio
Signed-off-by: Jan Musial <jan.musial@intel.com>
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-02-24 14:56:09 +01:00
Adam Rutkowski
17eddab094 pyocf: queue settle functionality
Queue settle is a mechanism to wait for all OCF processing
on a given queue to finish.

In some tests simply waiting for I/O to finish is not enough. Most
notably some statistics are potentially incremented after user triggered
I/O is finished. This is due to asynchronous nature of I/O operations
and OCF approach to statistics update, where only eventual consistency
is guaranteed without explicit mechanism available to query whether
the final state is reached yet. However it is fully in the adapter power
to determine this, as OCF executes in context of API calls from the
adapter (like I/O submission, ocf_queue_run, ocf_cleaner_run, management
operations) and I/O completion callbacks. Queue settle is a mechanism to
assure ocf_queue_run is not being executed by the thread associated with
a queue.

With queue settle mechanism it is straightforward for the adapter to
wait for cache statistics to reach fixed values:
1. wait for all I/O to OCF to finish
2. settle all I/O queues
3. make sure background cleaner is not active

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-02-24 14:56:09 +01:00
Jan Musial
41732090ae Implement rio io tester for pyocf
rio stands for Rigid IO tester and is a simple mechanism for testing
OCF cache IO.

Signed-off-by: Jan Musial <jan.musial@intel.com>
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-02-24 14:56:09 +01:00
Jan Musial
96124ca87a Enable Size comparisons in pyocf
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 14:56:09 +01:00
Jan Musial
9fcc7bfbb7 Use new capabilities in surprise shutdown tests
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Jan Musial
5d31dd87d0 Test for open_cores load
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Jan Musial
973a474b37 Make open_cores load viable by adding getter for cores
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Jan Musial
53d2c5a197 Fix test_start_stop_noqueue
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Jan Musial
bfee654770 Add wrapper for cache_config_set_default
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Jan Musial
2038c3aa68 Add basic load test with core reattachment and cleanup structures
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Jan Musial
30fe2eb783 Handle try_add core adding mode
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-24 12:27:10 +01:00
Piotr Debski
08907dae5d test for load with changed core size
removing xfail mark and update core oprations after merged ocf patch

Signed-off-by: Piotr Debski <piotr.debski@intel.com>
2022-02-18 23:15:47 +01:00
Jan Musial
1273e9ddfe Fix leaking Volumes and OcfCtx's
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-16 07:06:05 +01:00
Jan Musial
8f47cfa5bf Make multiple pyocf loggers viable
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-16 07:06:05 +01:00
Jan Musial
441e3c20d7 Clean-up pyocf c-python shared objects instance tracking
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-16 07:06:05 +01:00
Jan Musial
4c9d4fe24e Fix pyocf Ctx ownership
Signed-off-by: Jan Musial <jan.musial@intel.com>
2022-02-16 07:06:05 +01:00
Robert Baldyga
da59a1c9aa
Merge pull request #634 from arutk/mopft_21.12
pyocf: management operation power failure tests
2022-02-14 14:10:52 +01:00
Robert Baldyga
49abe816ce
Merge pull request #649 from pdebski21/1023
fix for issue #1023
2022-02-07 16:17:14 +01:00
Robert Baldyga
76684ed8a9
Merge pull request #642 from robertbaldyga/parallelize
Parallelize metadata initialization
2022-02-07 13:53:45 +01:00
Robert Baldyga
53f6cffe7f tests: Add unit tests for bisect generator
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-31 06:59:28 +01:00
Robert Baldyga
b70492ad3d Parallelize ALRU recovery
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2022-01-31 06:59:28 +01:00
Piotr Debski
9b980d3f22 fix for issue #1023
Better error for core size mismatch during activation/load

adding pyocf test for new error code

Signed-off-by: Piotr Debski <piotr.debski@intel.com>
2022-01-25 05:18:16 +01:00
Adam Rutkowski
a97bc61010 pyocf: mark most surprise shutdown tests as long
.. to skip by default

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:42:42 +01:00
Adam Rutkowski
2b7a249143 pyocf: document custom markers in pytest.ini
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:42:42 +01:00
Adam Rutkowski
ae240f5aa8 pyocf: test update to handle zeroed metadata in attach
With atomic superblock commit during cache attach, it is possible
that power failure interrupts attach operation at a point where
neither new or old superblock is present - right after the superblock
is cleared.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:41:04 +01:00
Adam Rutkowski
366d89a9c4 pyocf: management operation power failure handling tests
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:40:44 +01:00
Adam Rutkowski
ce0bbc260e pycof: explicitly free Volume::_uuid_ dictionary
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:35:33 +01:00
Adam Rutkowski
7f60aa0dd6 pyocf: fix error handling in Cache::stop()
Write error in cache stop means the instance was in fact stopped.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:35:33 +01:00
Adam Rutkowski
ed5185e870 pyocf: make io class config more usable
Unify field param names and include io class id in info struct.

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:35:33 +01:00
Adam Rutkowski
5fe217d96f pyocf: set proper OCF error codes in Volume
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:35:33 +01:00
Adam Rutkowski
c43059a4cf pyocf: add get_bytes() function to Volume and Data
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:35:33 +01:00
Adam Rutkowski
683174c78f pyocf: add option to load cache without openning cores
... this is useful to workaround current pyocf limitations and
load cache with manual core insertion

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:35:33 +01:00
Adam Rutkowski
58dac85f7b pyocf: add ocf_core_get_uuid() wrapper
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 17:35:29 +01:00
Adam Rutkowski
c7144decf8 pyocf: extend error volume capabilities
Adding option to
1. inject error based on I/O number
2. arm/disarm error injection for easier testing

Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 16:40:54 +01:00
Adam Rutkowski
cf72664c2c pyocf: fix cache device config
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2022-01-13 16:40:54 +01:00
Piotr Debski
609a22cfda added ERROR code for superblock mismatch
Signed-off-by: Piotr Debski <piotr.debski@intel.com>
2022-01-08 23:06:10 +01:00
Robert Baldyga
716b5751d6 Redesign failover standby API
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-29 20:31:40 +01:00
Robert Baldyga
cac5869406
Merge pull request #603 from robertbaldyga/metadata-flapping
Introduce flapping of metadata config sections
2021-12-15 17:11:15 +01:00
Robert Baldyga
98cb9bff70 pyocf: Use bigger cache device size in tests
As amount of fixed size metadata allocated by OCF grows, we need to adjust
test to not try to start cache on device that is too small.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-15 15:30:34 +01:00
Robert Baldyga
6d1a5c733e pyocf: Add missing error codes
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-13 15:58:59 +01:00
Rafal Stefanowski
decfc8dea6 Remove executable bit from Makefile
Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-11-24 17:01:03 +01:00
Rafal Stefanowski
f22da1cde7 Fix license
Change license to BSD-3-Clause

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-10-28 13:08:50 +02:00
Krzysztof Majzerowicz-Jaszcz
71262d5097 Cache standby mode API changes
Error for an invalid cache operation while in passive mode added

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>

Error name correction

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>

API changes for passive cache mode

Moved the passive cache error return source to the api for flush and
set_param

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>

Further API changes for passive cache mode

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>

 Passive api - review changes

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2021-10-22 15:10:53 +02:00