Commit Graph

17 Commits

Author SHA1 Message Date
Joe Thornber
e801cc607b [block_manager] Hard code block size to 4k.
We're never going to use anything other than 4k, and by hard coding it we
avoid making block_manager a template.
2020-04-30 14:30:01 +01:00
Joe Thornber
5f2c3bed69 Add some ftests, and fixup whitespace from Nikhil's work 2019-10-28 11:52:21 +00:00
Nikhil Kshirsagar
91b4714e38 Corrupt superblock repair 2019-10-25 15:02:56 +05:30
Joe Thornber
0fc7529c01 [cache_repair, thin_repair] fix bug introduced in recent patch
I hadn't realised that check_file_exists() also checked that it was
a regular file, which we don't want for the couple of uses I recently
added.

This patch adds an optional arg must_be_regular_file, and defaults
it to true, preserving the original behaviour.  The recent additions
have this set to false.
2019-10-14 09:21:38 +01:00
Joe Thornber
1dd7b454bb [thin_repair, cache_repair] Check input file exists earlier
and zero superblock if we fail part way through a repair.

bz1499781
2019-10-08 14:34:24 +01:00
Joe Thornber
9e20465fd1 [thin-repair, thin_dump] When repairing we now hunt for the best btree roots.
We've had a trickle of users who accidentally activate the same pool on a
VM and host at the same time.  Typically the host doesn't do any IO, but
the kernel will still rewrite the superblock on shutdown.  This leaves
the superblock pointing to very out of date btree roots and so we get
massive metadata loss.

This patch changes thin_repair, and thin_dump --repair.  They now hunt
for the most recent, undamaged and consistent roots of the device and
mapping trees, and use that as the starting point of the repair.
2019-04-17 12:17:13 +01:00
Joe Thornber
c2fdbad322 Merge branch '2016-07-07-improve-thin-repair-error-message' into v0.7-devel
Conflicts:
	Makefile.in
	VERSION
	configure.ac
	persistent-data/file_utils.cc
2016-07-11 15:51:30 +01:00
Joe Thornber
4779fb9b80 [various] Improve documentation
Output file must be preallocated.
2016-07-11 14:53:03 +01:00
Joe Thornber
a3f4940f1e [thin_dump] --dev-id 2016-03-22 14:46:33 +00:00
Joe Thornber
b0e2d0e6a0 [thin_repair, metadata] Try harder to get the number of data blocks
when opening the metadata.
2016-03-21 17:17:57 +00:00
Joe Thornber
2cf0c84ce3 [thin_repair] we need to read the space maps after all to get the data
volume size.
2016-03-21 15:36:49 +00:00
Joe Thornber
2815aeace9 [thin_repair] fix regression in thin_repair
When opening the corrupted metadata we don't need to touch the space
maps.  This used to be achieved by pretending we were opening a
metadata snap at block 0 (superblock location).  But got changed in
the recent rationalisation of the metadata constructors.

This patch introduces a bool to the metadata OPEN constructor that
says whether the space maps are needed or not.
2016-02-16 14:08:43 +00:00
Joe Thornber
c93e728ef4 [base] introduce a command type that gets registered with the app 2016-01-08 12:51:52 +00:00
Joe Thornber
30a3bf67d1 [thin tools] Change the metadata contructors to take a block_manager<>::ptr
Also check any metadata snap passed in matches what's in the superblock.
2015-12-14 15:29:57 +00:00
Joe Thornber
6f8b7e2914 [all] Build a single executable 2014-08-27 14:01:31 +01:00
Joe Thornber
dd26ec76b2 [thin_repair] don't open the space maps in the old metadata, we'll regenerate. 2013-08-02 13:14:49 +01:00
Joe Thornber
21074456ca thin_repair 2013-06-19 12:39:28 +01:00