Shrink writecache #1298
No reviewers
Labels
No labels
P0
P1
P2
P3
badger
frostfs-adm
frostfs-cli
frostfs-ir
frostfs-lens
frostfs-node
good first issue
triage
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No milestone
No project
No assignees
5 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-node#1298
Loading…
Reference in a new issue
No description provided.
Delete branch "dstepanov-yadro/frostfs-node:feat/drop_writecache_bolt_db"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
frostfs-cli control writecache seal
supportsrestore-mode
flag to restore writecache's mode to current mode after sealing (writecache seal
assumes flush and move to disabled mode)frostfs-cli control writecache seal
supportsshrink
flag to recreate db after flush to reduce disk size used by bbolt databasecee87c13ca
toba50e46c30
ba50e46c30
toef2cc1df3b
@ -68,6 +77,8 @@ func initControlShardsWritecacheCmd() {
ff.StringSlice(shardIDFlag, nil, "List of shard IDs in base58 encoding")
ff.Bool(shardAllFlag, false, "Process all shards")
ff.Bool(ignoreErrorsFlag, true, "Skip invalid/unreadable objects")
ff.Bool(restoreModeFlag, false, "Restore writecache's mode after sealing")
We replaced
flush-cache
withseal
specifically to denote it's meaning in the name.With this flag it is no longer
seal
.Why is it neccessary to have this flag?
It was the real case, when we needed to flush and recreate writecache's bbolt DB.
Agree, with this flag it looks like step back. But
writecache seal
will have async execution, so I decided to add this flag here.OK, I am too tired to argue.
The help message needs to be altered somehow
No need to argue. You asked a question, I answered it. If you do not agree with this decision, then tell me how to do it.
@ -26,3 +29,3 @@
defer c.modeMtx.Unlock()
err := c.setMode(ctx, m, true)
err := c.setMode(ctx, m, true, false)
What about
prm
struct for this?true, false
is indistinguishable fromfalse, true
Or maybe bitmask flags.
Fixed
@ -74,0 +88,4 @@
b := tx.Bucket(defaultBucket)
cs := b.Cursor()
k, v := cs.First()
empty = len(k) == 0 && len(v) == 0
b.Stats().KeyN
?Fixed
@ -74,0 +100,4 @@
if empty {
err := os.Remove(filepath.Join(c.path, dbName))
if err != nil && !os.IsNotExist(err) {
return fmt.Errorf("failed to remove DB file: %w", err)
The function seems no longer idempotent because of this: if we retry, we will fail on
c.db.View
withErrClosed
Good point. Fixed. Now assume already closed DB as non empty.
@ -657,1 +657,4 @@
bool ignore_errors = 2;
// If true, then writecache will be sealed, but mode will be restored to the current one.
bool restore_mode = 4;
Why not 3?
3 is taken here #1284/files
Next level conflict resolution, I must say!
ef2cc1df3b
to36efccd862