13 Commits

Author SHA1 Message Date
ncabatoff
804c83609e Rework assertion to follow etcd approach. Enable assertions in tests.
Signed-off-by: ncabatoff <ncabatoff@hashicorp.com>
2023-10-26 09:19:13 -04:00
Benjamin Wang
31914ea6e8 cmd: add meta page related surgery commands
Two command:
- surgery meta validate
- surgery meta update

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-10-18 16:55:03 +01:00
Allen Ray
18ebb97451 Update to go1.21.1
Signed-off-by: Allen Ray <alray@redhat.com>
2023-09-15 09:26:06 -04:00
Benjamin Wang
a78b0c40ed set page flags directly instead of XOR the value
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-05-19 19:33:21 +08:00
Benjamin Wang
b027e485ce cmd: print a warning to abandon the freelist if present in 'surgery copy-page' command
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-05-06 06:25:23 +08:00
Benjamin Wang
6adc0c47a6 move FreelistType from internal/common to top level package bbolt
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-04-12 07:32:45 +08:00
Josh Rickmar
7a957f94b2 Introduce errors package and restore API compatibility
This moves the error variables that had been moved to the
internal/common package during recent refactoring to a non-internal
errors package, once again allowing consumers to test for particular
error conditions.

To preserve API compatibility with bbolt v1.3, these error variables
are also redefined in the bbolt package, with deprecation notice to
migrate to bbolt/errors.

Signed-off-by: Josh Rickmar <jrick@zettaport.com>
2023-04-06 13:26:30 +00:00
Benjamin Wang
1776766466 move copyFile into internal/common/util.go
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-04-05 14:08:17 +08:00
Benjamin Wang
87eed0ac93 add test case to verify 'surgery-clear-elements' on overflow page
Also resolved a bug related to overflow page.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-25 07:42:01 +08:00
Benjamin Wang
15d561e54f move inode operations(read/write) into package internal/common
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-15 08:44:19 +08:00
Benjamin Wang
a3a9877de6 encapsulate the logic of checking the page type
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-08 10:47:59 +08:00
Benjamin Wang
852b1df32f refactor: move inode to internal/common package
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-04 04:22:09 +08:00
Benjamin Wang
34595e7231 create a common package
Points:
1. There are lots of duplicated definitions between bolt and
   guts_cli, which is definitely not good.
2. The implementation in guts_cli also has issue, please
   refer to https://github.com/etcd-io/bbolt/issues/391.
   This refactoring can fix the issue.

Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-03-04 04:22:09 +08:00