Commit Graph

66 Commits

Author SHA1 Message Date
Nikos Tsironis
9f30793355 [era_invalidate] Don't read the live metadata when the --metadata-snapshot option is provided
Until now, 'era_invalidate' read the live metadata (superblock), instead
of the metadata snapshot, when using the --metadata-snapshot parameter.

Fix this by passing the location of the metadata snapshot to
'open_metadata()', when a metadata snapshot is used.

Signed-off-by: Nikos Tsironis <ntsironis@arrikto.com>
2022-01-05 12:30:02 +02:00
Ming-Hung Tsai
f6eb5173c9 [era_restore] Avoid touching the output file by checking input file earlier
The output file has been checked by the caller, so there's no need
to check the output file again.
2021-10-21 17:51:28 +08:00
Ming-Hung Tsai
e7fa012701 [btree] Fix ref-counting on overwritten values 2021-09-22 17:05:59 +08:00
Ming-Hung Tsai
2e62363446 [all] Fix uninitialized class members 2021-06-03 18:54:26 +08:00
Ming-Hung Tsai
e8410dec04 [dbg] Add missing commands to cache/era_debug 2021-02-21 19:16:51 +08:00
Ming-Hung Tsai
a81cef4467 [dbg] Pull out common code into dbg-lib
- Modularize common routines
- Extract the block_dumper interface for displaying blocks
- Remove inheritance from show_traits
2021-02-21 01:04:35 +08:00
Ming-Hung Tsai
c95e31bef6 [era_debug] Display bitset entries in run-length fashion 2021-02-21 00:02:57 +08:00
Ming-Hung Tsai
afbd913e22 [era] Add era_debug 2021-02-18 23:40:39 +08:00
Joe Thornber
58cd881340 Fix regression where era_restore wouldn't work with devices.
check_file_exists() had an extra parameter added with a default, which was
the wrong default for era_restore.
2021-02-17 15:15:57 +00:00
Ming-Hung Tsai
6a2fa73924 [build] Enable building the dev-tools for functional tests
- Factor out the dev-tools into a stand-alone, no-installed program
- Built the dev-tools if --enable-testing is specified
- Remove the --enable-dev-tools configure option
- Allow suffix on the binary name
- Update symlinks
- Cleanup Makefile
2021-01-12 16:08:51 +08:00
Joe Thornber
29cfdd8979 [space-maps/core] rewrite the core space map to use less memory. 2020-05-27 12:00:40 +01:00
Joe Thornber
4313469475 [all] Switch from boost::shared_ptr -> std::shared_ptr.
Shared_ptr has moved into the standard library since these tools were
first written.
2020-04-30 15:02:43 +01:00
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
5e347dddbf [various] remove dead code.
Squashes warnings from clang++
2020-04-08 12:12:59 +01:00
Joe Thornber
207ef304c3 [era/restore_emitter] remove a noop
Pointless self assignment.  Value in suerpblock does get assigned properly.
2018-12-12 10:23:35 +00:00
Joe Thornber
f80200d179 [era_check] If the superblock fails the checksum try other checks. 2017-10-05 16:21:17 +01:00
csonto
5b5aa971a0 Detect XML in *_check tools (#86)
* [*_check] Detect XML in cache_check and era_check

This is based on previous commit b10d8d4440.

* [*_check] Fix typo in check_superblock
2017-10-05 13:47:10 +01:00
Joe Thornber
825a58922d [era_invalidate] Tweak --help message. 2017-10-05 12:48:36 +01:00
Joe Thornber
3c761e6822 [all tools] Factor out open_bm() and open_tm.
Many duplicates of this code.
2017-10-05 11:53:40 +01:00
Joe Thornber
924a996fa7 [era_restore] Ignore errors from zero_superblock.
Since it's on the error path.
2017-10-05 11:49:01 +01:00
Joe Thornber
5b92f410ec [*_restore] if things go wrong wipe the superblock.
So we don't leave the metadata device with partially restored metadata.
2017-09-28 14:39:24 +01:00
Joe Thornber
48e7ab89a5 [*_dump] Fix segfault when given a tiny metadata file 2017-09-21 10:22:38 +01:00
Joe Thornber
f7d79339e8 [man pages] Various updates. 2017-09-18 16:10:56 +01:00
Martin Pelikán
1be512580c Fix build with libc++ by disambiguating std::bitset away. (#83) 2017-08-26 12:53:33 +01:00
Ming-Hung Tsai
b7d418131d Spin-off syscall-related file operations (#78)
* [file_utils] spin-off syscall-related file operations

1. Eliminate the potential circular dependency between
   persistent-data/block.h and persistent-data/file_utils.h,
   if the former one wants to include the latter.
2. Avoid namespace pollution by removing the "using namespace std"
   declaration in block.tcc.
3. Correct the header hierarchy: base/xml_utils.h now no longer
   depends on the higher-level persistent-data/file_utils.h

* [file_utils] support block files in get_file_length()
2017-04-29 18:51:52 +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
Ming-Hung Tsai
778c153c1e [block-cache] Add check_raw() to bcache::validator 2016-02-27 15:21:13 +08: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
78b24dee19 [era_invalidate] Don't open in exclusive mode if using a metadata snap.
Patch from bobk-rey on github
2015-09-08 10:12:56 +01:00
Joe Thornber
25b4b526f4 Introduce error_string() as a portable replacement for strerror_r() 2015-01-16 12:54:09 +00:00
Joe Thornber
4c026458d5 Squash a couple of annoying compiler warnings 2014-09-02 10:13:26 +01:00
Joe Thornber
4c04a18b05 [era] era_dump should show bool values as 'true' or 'false' rather than 0 or 1 2014-09-01 14:45:05 +01:00
Joe Thornber
6f8b7e2914 [all] Build a single executable 2014-08-27 14:01:31 +01:00
Joe Thornber
828f654800 [*_restore] Add progress bar to cache_restore and era_restore.
A lot of refactoring common code between the restore tools.
2014-08-26 13:05:21 +01:00
Joe Thornber
d17ad86a88 [*_restore] Use a little wrapper class for the expat XML_Parser to ensure it gets destroyed. 2014-08-26 11:23:29 +01:00
Joe Thornber
a7c96c0e1e [everything] Fix circular shared pointer references.
We had a cycle from transaction_manager <-> space_map, and also from
the ref_counters back up to the tm.

This prevented objects being destroyed when various programs exited.

From now on we'll try and only use a shared ptr if ownership is
implied.  Otherwise a reference will be used (eg, for up pointers).
2014-08-26 11:14:49 +01:00
Joe Thornber
1a632f9d53 [era/xml restorer] bug fixes 2014-08-21 11:22:12 +01:00
Joe Thornber
5465c95134 [era/xml format] bring in line with the Ruby library 2014-08-21 11:21:47 +01:00
Joe Thornber
85ab149685 [era/metadata.{h,cc}] Support creation of new metadata 2014-08-21 11:20:43 +01:00
Joe Thornber
94356a1648 [era_check] Was returning after just checking the superblock.
Presumably old debug.
2014-08-15 10:11:35 +01:00
Joe Thornber
157eca4dd0 [era_restore] tweak help message 2014-08-12 10:20:29 +01:00
Joe Thornber
283ab4ad99 first drop of era_restore 2014-08-07 15:43:01 +01:00
Joe Thornber
8f73241119 [era] parser for the XML format 2014-08-06 16:30:38 +01:00
Joe Thornber
a75a2118a0 era_invalidate: update help to reflect --metadata-snapshot 2014-08-06 11:15:18 +01:00
Joe Thornber
7e870ea5a6 start removing block_manager<>::block 2014-07-25 14:46:51 +01:00
Joe Thornber
b32908d5c2 work in progress 2014-07-25 10:35:04 +01:00
Joe Thornber
d517684c95 Initial code drop for merging block_cache 2014-07-22 16:41:39 +01:00
Joe Thornber
e77e8715b0 Remove ambiguity between boost::uint64_t and ::uint64_t.
This has been causing people problems on uclibc builds.
2014-07-02 08:19:20 +00:00
Joe Thornber
5e3f4cf532 [era] Provide a default ctr for era_detail to quieten coverity 2014-06-26 15:35:48 +01:00