Commit Graph

1293 Commits

Author SHA1 Message Date
Robert Baldyga
0ac66ce4aa Fix cache stop after standby detach
Don't attempt to close cache volume if cache is in standby detached state.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-23 22:39:37 +01:00
Robert Baldyga
04da4fd4ef
Merge pull request #624 from beef9999/fix-completion-order
fix volume_close completion order
2021-12-22 12:38:02 +01:00
Bob Chen
b6de614ada fix volume_close completion order
Signed-off-by: Bob Chen <beef9999@qq.com>
2021-12-22 15:18:34 +08:00
Robert Baldyga
7fd118a734
Merge pull request #623 from Open-CAS/revert-620-fix-completion-order
Revert "fix volume_close completion order"
2021-12-21 20:34:58 +01:00
Robert Baldyga
a2916313ee
Revert "fix volume_close completion order" 2021-12-21 20:33:34 +01:00
Robert Baldyga
94ed3dc6d6
Merge pull request #620 from beef9999/fix-completion-order
fix volume_close completion order
2021-12-21 10:40:34 +01:00
chenbo
aa6e674034 fix volume_close completion order 2021-12-20 20:10:07 +08:00
Robert Baldyga
067f7ad074
Merge pull request #612 from robertbaldyga/fix-metadata-flapping
Fix metadata flapping
2021-12-16 13:08:58 +01:00
Robert Baldyga
0751b2c0c0 Fix metadata flapping
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-15 22:21:57 +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
df9a9f2722 Read superblock sections from cache volume during activate
Because of metadata flapping it is much more complicated to capture those
sections in flight in standby mode, so we read them directly from the cache
volume during the activate.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-15 15:30:34 +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
99c8c05f3f Introduce flapping of metadata config sections
This feature provides double buffering of config sections to prevent
situation when power failure during metadata flush leads to partially
updated metadata. Flapping mechanism makes it always possible to perform
graceful rollback to previous config metadata content in such situation.

Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-12-15 15:30:34 +01:00
Robert Baldyga
058d701f8c
Merge pull request #607 from robertbaldyga/pyocf-add-error-codes
pyocf: Add missing error codes
2021-12-14 16:03:05 +01:00
Robert Baldyga
ee92a0fe7c
Merge pull request #610 from loyou/open-cas-linux-issue-1015
Fix incorrect page count calculation with large PAGE_SIZE
2021-12-14 16:02:38 +01:00
Neil Sun
7f82ef3048 Fix incorrect page count calculation with large PAGE_SIZE
e.g., PAGE_SIZE 65536, cache line 8k.

fix https://github.com/Open-CAS/open-cas-linux/issues/1015

Signed-off-by: Sun Feng <loyou85@gmail.com>
2021-12-14 20:07:59 +08: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
Robert Baldyga
60218759d2
Merge pull request #597 from rafalste/fix_core_zero_size_error
Fix core-zero-size error
2021-12-08 22:04:27 +01:00
Robert Baldyga
21c4673251
Merge pull request #600 from mmichal10/cleaning-cmpl
Call completion if failed to perform cleaning
2021-12-08 22:00:58 +01:00
Robert Baldyga
e3a58b93fa
Merge pull request #599 from mmichal10/use-after-free
Fix a few memory management related issues
2021-12-08 21:59:52 +01:00
Michal Mielewczyk
d6f2998890 Call completion if failed to perform cleaning
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-12-08 14:50:50 +01:00
Michal Mielewczyk
911a5cddf0 Deinit all registered volume types
Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-12-08 14:16:49 +01:00
Michal Mielewczyk
655f732748 Don't access freed memory
Instead of accessing memory of a freed IO, redo size calculations

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-12-08 14:16:49 +01:00
Michal Mielewczyk
244712b020 Prevent race condition in fast path
Request submitted in fast path may be freed before the sequential cutoff stats
are updated. Increment request reference counter to prevent it.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-12-08 09:00:04 +01:00
Rafal Stefanowski
b57bad4652 Fix core-zero-size error
Move error print to where it belongs, preventing this message to
pop up when same error code is reported elsewhere for other reason.

Signed-off-by: Rafal Stefanowski <rafal.stefanowski@intel.com>
2021-12-06 12:30:29 +01:00
Robert Baldyga
aac21cab63
Merge pull request #592 from rafalste/makefile_fix
Remove executable bit from Makefile
2021-11-30 15:34:43 +01:00
Robert Baldyga
cba5d94241
Merge pull request #590 from arutk/fowd
Remove option to failover without detach
2021-11-30 15:33:35 +01:00
Adam Rutkowski
b1494f4642 Remove option to failover without detach
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-11-30 15:18:08 +01:00
Robert Baldyga
aeca11a9c9
Merge pull request #577 from arutk/sample_fix
simple sample: offset handling fixes in data and volume
2021-11-30 15:01:30 +01:00
Robert Baldyga
706bc8407b
Merge pull request #595 from arutk/passive_fix
fix cacheline reset in passive metadata update
2021-11-30 15:00:50 +01:00
Adam Rutkowski
b455a393dd extra assertion in metadata passive update
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-11-30 12:04:57 +01:00
Adam Rutkowski
d0b00817f3 fix cacheline reset in passive metadata update
Signed-off-by: Adam Rutkowski <adam.j.rutkowski@intel.com>
2021-11-30 19:34:52 +01:00
Robert Baldyga
63f5ba88c9
Merge pull request #591 from Open-CAS/fix_for_988_997
Fix for issues #988 and #997
2021-11-26 17:03:06 +01:00
Robert Baldyga
e72018bc02
Merge pull request #593 from robertbaldyga/ocf-err-min-max
Introduce OCF_ERR_MIN/OCF_ERR_MAX
2021-11-25 16:14:31 +01:00
Robert Baldyga
12160ccc36 Introduce OCF_ERR_MIN/OCF_ERR_MAX
Signed-off-by: Robert Baldyga <robert.baldyga@intel.com>
2021-11-25 15:53:24 +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
Krzysztof Majzerowicz-Jaszcz
133ea307c8 Fix for issues #988 and #997
This patch fixes the issue 988 (and 997) causing a kernel stack
overflow.

Signed-off-by: Krzysztof Majzerowicz-Jaszcz <krzysztof.majzerowicz-jaszcz@intel.com>
2021-11-24 08:15:07 +01:00
Robert Baldyga
8669a296cc
Merge pull request #579 from mmichal10/fix-passive-update
Maintaining runtime metadata structures in failover standby
2021-11-19 16:53:54 +01:00
Michal Mielewczyk
4ab22ee2dc Maintain runtime struct during failover standby
To allow the fastest switching from the passive-standby to active mode, the
runtime metadata must be kept 100% synced with the metadata on the drive and in
the RAM thus recovery is required after each collision section update.

To avoid long-lasting recovering of all the cachelines each time the collision
section is being updated, the passive update procedure recovers only those
which have its MD entries on the updated pages.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:58:09 +01:00
Michal Mielewczyk
a6989d1881 Pio concurrency 2021-11-19 11:58:09 +01:00
Michal Mielewczyk
52824adaaf Additional cleaning policy info outside of the SB
Starting cache in a standby mode requires access to a valid cleaning policy
type. If the policy is stored only in the superblock, it may be overridden by
one of the metadata passive updates.

To prevent losing the information it should be stored in cache's runtime
metadata.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
0e529479d6 Init cleaner during passive start
Initializing cleaning policy is very time consuming. To reduce the time required
for activating cache instance the initialization sholud be done during passitve
start

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
390e80794d Refactor cleaning policy initialization
Extract cleaning policy initialization to a separate function

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
6d4e6af5b6 Recovery on passive start
Adjust recovery procedure to allow rebuilding metadata from partialy valid
metadata

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
11dacd6a84 Set dirty shutdown status on standby init
Since part of the recovery is done during `standby init`, the correct shutdown
status has to be set

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
8f58add152 Lru populate unsafe
The unsafe mode is useful if the metadata of added cores is incomplete.

Such scenario is possible when starting cache to standby mode from partially
vaild metadata.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
4deaa1e133 Reset all the status bits during recovery
Make sure all the invalid cachelines have reset status bits. This allows to
recognize invalid cachelines easily during populate.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
fc7c901c8b Skip collision init on cache start passive
Recovery during passive start is based on the assuption that metadata collision
section stored on disk might be partially valid. Reseting this data would make
rebuilding metadata impossible.

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
048bbedd71 Fix metadata_clear_valid_if_clean()
The function should return the cacheline's valid status

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00
Michal Mielewczyk
bb0ff67fe9 Metadata clear_dirty_if_invalid() utility
Fix cacheline's metadata if it is dirty and invalid

Signed-off-by: Michal Mielewczyk <michal.mielewczyk@intel.com>
2021-11-19 11:53:48 +01:00