Don't fsync immediately after all writes (#1490)

This commit is contained in:
stasatdaglabs 2021-02-04 16:36:46 +02:00 committed by GitHub
parent 8941c518fc
commit a792d4a19e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -8,6 +8,7 @@ var (
BlockCacheCapacity: 256 * opt.MiB, BlockCacheCapacity: 256 * opt.MiB,
WriteBuffer: 128 * opt.MiB, WriteBuffer: 128 * opt.MiB,
DisableSeeksCompaction: true, DisableSeeksCompaction: true,
NoSync: true,
} }
// Options is a function that returns a leveldb // Options is a function that returns a leveldb

View File

@ -4,7 +4,6 @@ import (
"github.com/kaspanet/kaspad/infrastructure/db/database" "github.com/kaspanet/kaspad/infrastructure/db/database"
"github.com/pkg/errors" "github.com/pkg/errors"
"github.com/syndtr/goleveldb/leveldb" "github.com/syndtr/goleveldb/leveldb"
"github.com/syndtr/goleveldb/leveldb/opt"
) )
// LevelDBTransaction is a thin wrapper around native leveldb // LevelDBTransaction is a thin wrapper around native leveldb
@ -41,7 +40,7 @@ func (tx *LevelDBTransaction) Commit() error {
} }
tx.isClosed = true tx.isClosed = true
return errors.WithStack(tx.db.ldb.Write(tx.batch, &opt.WriteOptions{Sync: true})) return errors.WithStack(tx.db.ldb.Write(tx.batch, nil))
} }
// Rollback rolls back whatever changes were made to the // Rollback rolls back whatever changes were made to the