106 Commits

Author SHA1 Message Date
Benjamin Wang
ff467f2ff5 addresed review comments
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-01-16 19:08:53 +08:00
Benjamin Wang
8df4afc24b add 'bbolt surgery revert-meta-page' command
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-01-16 18:32:41 +08:00
Benjamin Wang
376af859cb move all common fields into baseCommand
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-01-16 14:58:01 +08:00
Piotr Tabor
f16e2522ce Address review comments.
Signed-off-by: Piotr Tabor <ptab@google.com>
2023-01-13 19:14:45 +01:00
Piotr Tabor
0c8d75db1e Recursive checker implementation.
Recursive checker confirms database consistency with respect to b-tree
key order constraints:
  - keys on pages must be sorted
  - keys on children pages are between 2 consecutive keys on parent
branch page).

Signed-off-by: Piotr Tabor <ptab@google.com>
2023-01-13 19:14:45 +01:00
Benjamin Wang
6bc57389f0 add PreLoadFreelist to support loading free pages in readonly mode
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2023-01-11 18:10:12 +08:00
Piotr Tabor
9f841cc213 Fix goimports and scripts.
Signed-off-by: Piotr Tabor <ptab@google.com>
2023-01-03 19:02:55 +01:00
Piotr Tabor
8961219de8 Execution of ./scripts/fix.sh
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-30 12:59:02 +01:00
Piotr Tabor
fc83b20869 Factor out low-lever access to pages out of CLI into internal/guts.
Long-term guts_cli should get replaced by the main code from bbolt main code.

Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-28 16:53:03 +01:00
Piotr Tabor
1f46d6c7e7 cmd/main_test.go is using btesting as well.
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-28 15:18:46 +01:00
Benjamin Wang
329eba7818 Open db file in readonly mode for commands which shouldn't update db file
Signed-off-by: Benjamin Wang <wachao@vmware.com>
2022-12-27 12:58:32 +08:00
Piotr Tabor
577a4d99b9 bbolt page supports --all and --value-format=redacted formats.
--all - prints all pages (only skips pages that were considered successful overflow pages)
--value-format=redacted just prints a length of the value, to reduce length and protect privacy.

The auto & redacted formats are supported in all tools that accept '--format'.

Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-22 09:56:16 +01:00
Piotr Tabor
cc771afa1e Move page command to a separate file. It's already a huge file of tools.
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-19 00:42:54 +01:00
Piotr Tabor
bad964e850
Merge pull request #354 from ptabor/20221214-fix-bbolt-safety
Add safeguards to bbolt CLI tool
2022-12-18 13:17:08 +01:00
Piotr Tabor
c34493c3d1 Safety check to 'bbolt page' command.
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-17 14:43:12 +01:00
Piotr Tabor
4acf9d93a5 Fixing golangci warnings.
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-16 16:08:56 +01:00
Piotr Tabor
5495c633ad bbolt get support --parseFormat and --format flags.
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-07 22:36:11 +01:00
Piotr Tabor
ed3e67c69b writelnBytes method has cleaner contract
Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-07 22:36:11 +01:00
Piotr Tabor
b9199f476d Add support for --format flag for 'bbolt keys' command.
This allows to print keys as 'hex', especially useful in context of etcd revisions:
  ./bbolt keys --format=hex ./foo/db key

Signed-off-by: Piotr Tabor <ptab@google.com>
2022-12-07 22:36:11 +01:00
missinglink
e7e1f0c05a cmd/bbolt: re-enable "bbolt" testing
Signed-off-by: missinglink <insomnia@rcpt.at>
2022-11-30 11:20:27 +01:00
Manuel Rüger
33c86c78ca .github: Enable lint
Signed-off-by: Manuel Rüger <manuel@rueg.eu>
2022-10-20 22:47:35 +02:00
Holger Bartnick
fd5535f71f
support sub buckets in get+keys (#295)
add possibility to get keys and values of sub buckets
2022-02-25 20:50:46 -08:00
Benjamin
d5db64bdbf
upgrade golang to 1.17 and replace iouitl with io and os (#297) 2022-01-29 19:28:06 -08:00
Peter Johnson
9b8a60db84
compact: open src file readonly (#292) 2022-01-28 18:37:59 -08:00
qingyunha
d043936a71
cmd/bbolt: pagesCommand no need db.Update (#226)
Co-authored-by: Tao Qingyun <taoqy@ls-a.me>
2021-04-23 17:41:42 -07:00
Michael Hendricks
615d5f6d3f
Replace bolt with bbolt in command line usage (#235)
The bbolt command line tool was renamed after the fork, but its usage output still used the old name.
2021-04-23 17:41:22 -07:00
Andrew Martinez
56f6a30657 fix etcd-io/bbolt#247 move compact logic
- add todo
2020-10-22 10:18:25 -04:00
Christian Muehlhaeuser
0bf4edcf32 Avoid unnecessary conversions
No need to convert here, they are already of the right type.
2019-08-06 17:35:28 +00:00
Gyuho Lee
b951856120 cmd/bbolt: disable "bbolt" testing for now
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 08:48:31 -07:00
Gyuho Lee
76a4670663 *: update import paths "go.etcd.io/bbolt"
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-28 08:15:54 -07:00
Gyuho Lee
8c8b786149 cmd/bolt: update import paths
Signed-off-by: Gyuho Lee <leegyuho@amazon.com>
2018-08-27 19:24:48 -07:00
Joe Betz
69918b9e4e Fix bolt CLI tool print entire freelist, and to dump keys/value bytes of leaf elements. 2017-09-20 12:08:57 -07:00
Gyu-Ho Lee
c3092301af *: go vet fixes
Signed-off-by: Gyu-Ho Lee <gyuhox@gmail.com>
2017-08-11 13:47:10 -07:00
Lewis Marshall
0ca39ebe25 Add "buckets", "keys" and "get" CLI commands
These were previously removed but I find them quite useful so have
reintroduced them.

Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-08-11 11:13:11 -07:00
Lewis Marshall
f07641f90a Add "dump" and "page" commands to CLI usage
Signed-off-by: Lewis Marshall <lewis@lmars.net>
2017-08-11 11:12:22 -07:00
Anthony Romano
533739c662 Merge pull request #17 from heyitsanthony/fix543
Fix issue #543 'bolt bench crashes'
2017-08-11 10:43:53 -07:00
Anthony Romano
c5d7f33536 Merge pull request #22 from heyitsanthony/fill-compact
Set FillPercent=1.0 in 'bolt compact'.
2017-08-11 10:05:38 -07:00
dogben
ef8e711cfb Set FillPercent=1.0 in 'bolt compact'.
By default, pages are split when they reach half full. For 'bolt compact' we want to fill the entire page for maximum compaction.
2017-08-10 22:58:57 -07:00
Anthony Romano
32c9f9e929 pass unused 2017-08-10 22:07:25 -07:00
Anthony Romano
e5514a24a6 pass gosimple 2017-08-10 22:07:25 -07:00
Christian Mauduit
319a33c534 Fix issue #543 'bolt bench crashes'
Added a test to check that bucket is actually non-nil before getting a
cursor on it. This happens when querying non-bucket entries, the
Bucket() method does not return explicit errors, so we can guess it's
probably because it's a key of the wrong type (ie: not leaf). No clear
idea wether the results in the case described '-read-mode=seq
-write-mode=rnd-nest' really do make sense, it looks like read are
zero whatsoever.
2017-08-10 21:14:06 -07:00
Gyu-Ho Lee
a30394a020 *: update git paths to 'coreos/bbolt' 2017-07-27 14:58:03 -07:00
Xiang
78b54a42e1 *: use coreos/bbolt as import path 2017-06-20 11:03:31 -07:00
Sebastian
4660afd75e hexidecimal -> hexadecimal
Small spelling fix :)
2017-01-28 10:26:39 +01:00
Ben Johnson
e72f08ddb5 Merge pull request #561 from zhujun2006/master
task#560 print leaf k/v with right value
2016-09-06 14:09:29 -06:00
Ben Johnson
f5d275b537
Minor bolt compact revisions 2016-09-05 15:43:02 -06:00
Ben Johnson
52d0f5e6a9
Merge branch 'compact-db' of https://github.com/vincent-petithory/bolt into vincent-petithory-compact-db 2016-09-01 14:47:06 -06:00
stone1342006
60fbb2c9fa task#560 print leaf k/v with right value 2016-05-18 22:56:05 +08:00
Rodolfo Carvalho
10b100fe0f Fix bolt stats output 2015-12-05 19:56:31 +01:00
Vincent Petithory
3279c88f26 compact: allow splitting transactions for large datasets 2015-11-19 19:18:07 +01:00