Commit Graph

141 Commits

Author SHA1 Message Date
Ming-Hung Tsai
e7fa012701 [btree] Fix ref-counting on overwritten values 2021-09-22 17:05:59 +08:00
Joe Thornber
63b8b9fc40 Clarify a namespace.
See issue 184.
2021-08-04 13:46:30 +01:00
Ming-Hung Tsai
c496e8a4c8 [btree] Remove FIXMEs 2021-03-25 16:42:36 +08:00
Ming-Hung Tsai
8bfe7ee6f3 [btree] Fix rebalancing checks 2021-03-25 15:06:52 +08:00
Ming-Hung Tsai
61f07573e1 [metadata_counter] Count under populated nodes if the option is provided 2020-11-24 18:18:21 +08:00
Ming-Hung Tsai
12725983db [block_counter] Add the stop-on-error option to prevent silent errors
The stop-on-error option aims to solve the lack of damage_visitor support
in space_map::count_metadata and btree counting_visitor. To prevent
possibly silent errors during space map or btree counting, the option
stops the counting process immediately when a btree or bitmap error
was found.

The bitmap blocks are also validated to avoid potential false-alarm,
if broken bitmap is not counted, and the corresponding ref-count is
also zeroed.
2020-08-12 15:56:26 +08:00
Ming-Hung Tsai
e62022a200 [base] Move run_set to namespace base 2020-07-29 15:33:25 +08:00
Joe Thornber
fec11289b0 [thin_check/dump] Under populated nodes are now 'non fatal errors'
thin_dump always ignores non-fatal-errors.
2020-07-02 16:03:23 +01:00
Ming-Hung Tsai
cf127f3471 [btree] Fix reference counts of children below a shadow 2020-06-30 17:24:55 +08:00
Ming-Hung Tsai
4f8466c489 [btree] Fix parent key index for the new shadow 2020-06-30 17:22:47 +08:00
Ming-Hung Tsai
5260a87c0b [base] Move math_utils to namespace base 2020-06-19 18:07:55 +08:00
Ming-Hung Tsai
e724a72045 [btree] Implement btree::remove() 2020-06-19 18:07:55 +08:00
Ming-Hung Tsai
f803c44e93 [btree] Implement btree::destroy() to delete the entire tree
Also decrease the reference count of the mapped values.
(e.g., bitmap blocks of btree_index_store)
2020-06-19 18:07:55 +08:00
Joe Thornber
0ab509578f [*_check] Remove the inane "This is not the btree you are looking for." message. 2020-06-11 13:05:03 +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
ad79b627a4 Merge branch 'master' of github.com:jthornber/thin-provisioning-tools 2020-04-08 12:30:26 +01:00
Joe Thornber
1481ed0f8a [ref_counter] Make ref_counter an abstract base class.
Forces people to override correctly.

Also make no_op_ref_counter final.
2020-04-08 12:22:28 +01:00
Joe Thornber
501299a4ee [cache_*] array ref_counter wasn't overloaded correctly.
Major bug, explains some space map issues I've seen when
restoring cache metadata.
2020-04-08 12:19:55 +01:00
Joe Thornber
0ccee1759e [various] Squash a couple of clang warning wrt friend declarations. 2020-04-08 12:18:24 +01:00
Joe Thornber
5e347dddbf [various] remove dead code.
Squashes warnings from clang++
2020-04-08 12:12:59 +01:00
Ming-Hung Tsai
d6a8c03aa2 [btree_damage_visitor] factor out non-template functions 2020-02-17 11:42:24 +00:00
Joe Thornber
aace49cdd6 [thin_repair] work in progress 2019-03-29 12:56:31 +00:00
Joe Thornber
467be1a69e Add some std namespaces to get tests building.
I guess a rogue header had previously been using the std namespace.
2017-07-24 15:40:17 +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
Ming-Hung Tsai
6863db6f86 [thin] fix duplicated counting of mapped blocks in restore emitter 2016-08-10 23:40:48 +08:00
Ming-Hung Tsai
60eb608825 [counting_visitor] fix the path for ValueCounter 2016-06-20 00:30:25 +08:00
Ming-Hung Tsai
2203e2b513 [btree_node_checker] tidy up the code
1. Add const qualifiers
2. Add virtual destructor
2016-05-20 00:53:35 +08:00
Ming-Hung Tsai
810e86e675 [counting_visitor] cleanup: remove redundant statements 2016-04-05 17:05:28 +08:00
Ming-Hung Tsai
9322fc9f14 [btree_damage_visitor] cleanup: remove redundant statements 2016-04-05 16:18:46 +08:00
Ming-Hung Tsai
1dce79bd55 [btree_damage_visitor] cleanup: use btree_node_checker 2016-04-05 16:09:58 +08:00
Ming-Hung Tsai
6dc9a90fec [counting_visitor] fix unnecessary value visiting
1. Do not inherit btree_damage_visitor to avoid unnecessary
   value visiting.
   (reverts commit b22495997a)
2. Use btree_node_checker to do node checking
2016-04-05 16:09:58 +08:00
Ming-Hung Tsai
4a4dc1a5e0 [btree_node_checker] first draft
Spin-off from btree_damage_visitor
2016-04-03 00:43:43 +08:00
Joe Thornber
3f6cae4ebc [persistent-data] persistent-data/data-structures/btree_key_value_extractor.h doesn't appear to be used
So remove
2016-02-29 11:12:50 +00:00
Ming-Hung Tsai
d068ec8082 Add utility class binary_block_counter 2016-02-27 15:22:09 +08:00
Ming-Hung Tsai
b22495997a Allow counting_visitor to work with damaged btrees 2016-02-27 15:22:00 +08:00
Ming-Hung Tsai
ad03114bf7 Add utility class btree_detail::key_value_extractor 2016-02-27 15:21:44 +08:00
Ming-Hung Tsai
c571a08f6c Add utility class btree_detail::noop_value_visitor 2016-02-27 15:21:32 +08:00
Ming-Hung Tsai
a48227188e Add utility class btree_detail::noop_damage_visitor 2016-02-27 15:21:23 +08:00
Ming-Hung Tsai
778c153c1e [block-cache] Add check_raw() to bcache::validator 2016-02-27 15:21:13 +08:00
Ming-Hung Tsai
d2260dee34 Show the block address in exception string 2016-02-27 15:04:08 +08:00
Ming-Hung Tsai
b1d4b9f7c8 Show the block address of error nodes 2016-02-27 15:04:08 +08:00
Ming-Hung Tsai
febe80f4bb [damage_visitor] update path_tracker in error_accessing_node() 2015-11-27 23:31:12 +08:00
Joe Thornber
71aea2efcc add btree_disk_structures.h 2015-08-13 14:28:07 +01:00
Joe Thornber
c32aaab028 [validators] Move the btree node validator into a separate file. 2015-08-11 11:58:07 +01:00
Joe Thornber
b67cc29609 [btree] bad checksum exceptions now mention the block location 2015-08-04 15:12:41 +01:00
Joe Thornber
c8d8af488f [btree] When using lower_bound() assign to an int rather than unsigned
Patch from Ming-Hung Tsai
2015-05-26 14:24:55 +01:00
Joe Thornber
cf903cfea6 [btree] lower bound search should return an empty optional if every entry in the node is higher.
Patch from Ming-Hung Tsai
2015-05-26 14:09:29 +01:00
Joe Thornber
880785a9bf [damage_tracker] Reset the tracker in the end() method so we can reuse it.
The *_check tools already reuse trackers.

Patch from Ming-Hung Tsai.
2015-05-26 12:49:27 +01:00
Joe Thornber
85d1701ba1 [btree_damage_visitor] Check the value_size agrees.
Patch from Ming-Hung Tsai
2015-05-26 12:06:34 +01:00