mirror of https://github.com/tailscale/tailscale/
tsconsensus: enable writing state to disk
The comments in the raft code say to only use the InMemStore for tests. Updates #16027 Signed-off-by: Fran Bull <fran@tailscale.com>pull/16148/head
parent
84aa7ff3bb
commit
c9a5d638e9
@ -0,0 +1,19 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
//go:build !loong64
|
||||
|
||||
package tsconsensus
|
||||
|
||||
import (
|
||||
"github.com/hashicorp/raft"
|
||||
raftboltdb "github.com/hashicorp/raft-boltdb/v2"
|
||||
)
|
||||
|
||||
func boltStore(path string) (raft.StableStore, raft.LogStore, error) {
|
||||
store, err := raftboltdb.NewBoltStore(path)
|
||||
if err != nil {
|
||||
return nil, nil, err
|
||||
}
|
||||
return store, store, nil
|
||||
}
|
||||
@ -0,0 +1,18 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
//go:build loong64
|
||||
|
||||
package tsconsensus
|
||||
|
||||
import (
|
||||
"errors"
|
||||
|
||||
"github.com/hashicorp/raft"
|
||||
)
|
||||
|
||||
func boltStore(path string) (raft.StableStore, raft.LogStore, error) {
|
||||
// "github.com/hashicorp/raft-boltdb/v2" doesn't build on loong64
|
||||
// see https://github.com/hashicorp/raft-boltdb/issues/27
|
||||
return nil, nil, errors.New("not implemented")
|
||||
}
|
||||
Loading…
Reference in New Issue