rogchap / wombat

Cross platform gRPC client
MIT License
1.39k stars 52 forks source link

VLOG causing crash #63

Open Kindred87 opened 3 years ago

Kindred87 commented 3 years ago

Wombat will enter a state where it always crashes immediately during startup before the GUI is visible. The issue is resolved when the VLOG file is deleted from the AppData\Roaming\Wombat\db directory. Not sure if it has to do with the size (2GB) or something else.

Running v0.50 on Windows 10.

db.zip

arkanmgerges commented 3 years ago

I'm getting also related to vlog db

Control time="2021-05-30T11:40:33+03:00" level=error msg="[App] app: failed to create database: During db.vlog.open: Value log truncate required to run DB. This might result in data loss" I needed to delete the content of AppData\Roaming\Wombat\db in order for Wombat to run again

Running on Windows 10 Pro

lukasvosyka commented 3 years ago

Having the same issue. Actually, why does it need a DB file of 2GB size?

Kindred87 commented 3 years ago

Having the same issue. Actually, why does it need a DB file of 2GB size?

When compressed, the directory contents are only 2-3 MB which makes me suspect that the process is writing repetitive information that bloats it up to the 2GB file size.

The error posted by @arkanmgerges matches in part ErrTruncateNeeded from BadgerDB. This error is only referenced in UpdateSkipList() during memtable creation.

badger/errors.go:99

// ErrTruncateNeeded is returned when the value log gets corrupt, and requires truncation of
// corrupt data to allow Badger to run properly.
ErrTruncateNeeded = errors.New(
             "Log truncate required to run DB. This might result in data loss")

badger/memtable.go:215

func (mt *memTable) UpdateSkipList() error {
    if mt.wal == nil || mt.sl == nil {
        return nil
    }
    endOff, err := mt.wal.iterate(true, 0, mt.replayFunction(mt.opt))
    if err != nil {
        return y.Wrapf(err, "while iterating wal: %s", mt.wal.Fd.Name())
    }
    if endOff < mt.wal.size && mt.opt.ReadOnly {
        return y.Wrapf(ErrTruncateNeeded, "end offset: %d < size: %d", endOff, mt.wal.size)
    }
    return mt.wal.Truncate(int64(endOff))
}