func IsRollbackError(err error) bool {
	_, ok := err.(RollbackError)
	return ok
}
IsRollbackError returns true if err is a RollbackError.
package lm2
import (
	"bytes"
	"encoding/binary"
	"errors"
	"fmt"
	"math/rand"
	"os"
	"sync"
	"sync/atomic"
)
const sentinelMagic = 0xDEAD10CC
const (
	maxLevels = 4
	levelProb = 0.1
	cacheProb = 0.1
)
var (
	ErrDoesNotExist = errors.New("lm2: does not exist")
	ErrInternal = errors.New("lm2: internal error")
	ErrKeyNotFound = errors.New("lm2: key not found")
	fileVersion = [8]byte{'l', 'm', '2', '_', '0', '0', '1', '\n'}
)
type RollbackError struct {
	DuplicateKey  bool
	ConflictedKey string
	Err           error
}
func (e RollbackError) Error() string {
	if e.DuplicateKey {
		return fmt.Sprintf("lm2: rolled back due to duplicate key (conflicted key: `%s`)",
			e.ConflictedKey)
	}
	return fmt.Sprintf("lm2: rolled back (%s)", e.Err.Error())
}