package surgeon
import "go.etcd.io/bbolt/internal/surgeon"
Index ¶
- func ClearFreelist(path string) error
- func ClearPage(path string, pgId common.Pgid) (bool, error)
- func ClearPageElements(path string, pgId common.Pgid, start, end int, abandonFreelist bool) (bool, error)
- func CopyPage(path string, srcPage common.Pgid, target common.Pgid) error
- func RevertMetaPage(path string) error
- type XRay
Functions ¶
func ClearFreelist ¶
func ClearPage ¶
func ClearPageElements ¶
func ClearPageElements(path string, pgId common.Pgid, start, end int, abandonFreelist bool) (bool, error)
ClearPageElements supports clearing elements in both branch and leaf pages. Note if the ${abandonFreelist} is true, the freelist may be cleaned in the meta pages in the following two cases, and bbolt needs to scan the db to reconstruct free list. It may cause some delay on next startup, depending on the db size.
- Any branch elements are cleared;
- An object saved in overflow pages is cleared;
Usually ${abandonFreelist} defaults to false, it means it will not clear the freelist in meta pages automatically. Users will receive a warning message to remind them to explicitly execute `bbolt surgery abandom-freelist` afterwards; the first return parameter will be true in such case. But if the freelist isn't synced at all, no warning message will be displayed.
func CopyPage ¶
func RevertMetaPage ¶
RevertMetaPage replaces the newer metadata page with the older. It usually means that one transaction is being lost. But frequently data corruption happens on the last transaction pages and the previous state is consistent.
Types ¶
type XRay ¶
type XRay struct {
// contains filtered or unexported fields
}
func NewXRay ¶
func (XRay) FindPathsToKey ¶
FindPathsToKey finds all paths from root to the page that contains the given key. As it traverses multiple buckets, so in theory there might be multiple keys with the given name. Note: For simplicity it's currently implemented as traversing of the whole reachable tree. If key is a bucket name, a page-path referencing the key will be returned as well.
Source Files ¶
surgeon.go xray.go
- Version
- v1.4.0 (latest)
- Published
- Feb 5, 2025
- Platform
- linux/amd64
- Imports
- 4 packages
- Last checked
- 3 hours ago –
Tools for package owners.