Skip to content

Commit

Permalink
Change default to 2x
Browse files Browse the repository at this point in the history
  • Loading branch information
alexanderbez committed May 27, 2020
1 parent bc63c8e commit 5c71cfb
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions physical/raft/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ var (

restoreOpDelayDuration = 5 * time.Second

defaultMaxEntrySize = uint64(3 * raftchunking.ChunkSize)
defaultMaxEntrySize = uint64(2 * raftchunking.ChunkSize)
)

// RaftBackend implements the backend interfaces and uses the raft protocol to
Expand Down Expand Up @@ -111,7 +111,7 @@ type RaftBackend struct {
permitPool *physical.PermitPool

// maxEntrySize imposes a size limit (in bytes) on a raft entry (put or transaction).
// It is suggested to use a value of 3x the Raft chunking size for optimal
// It is suggested to use a value of 2x the Raft chunking size for optimal
// performance.
maxEntrySize uint64
}
Expand Down
2 changes: 0 additions & 2 deletions physical/raft/raft_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,6 @@ func TestRaft_Backend_LargeValue(t *testing.T) {
b, dir := getRaft(t, true, true)
defer os.RemoveAll(dir)


value := make([]byte, defaultMaxEntrySize+1)
rand.Read(value)
entry := &physical.Entry{Key: "foo", Value: value}
Expand All @@ -236,7 +235,6 @@ func TestRaft_TransactionalBackend_LargeValue(t *testing.T) {
b, dir := getRaft(t, true, true)
defer os.RemoveAll(dir)


value := make([]byte, defaultMaxEntrySize+1)
rand.Read(value)

Expand Down
6 changes: 3 additions & 3 deletions website/pages/docs/configuration/storage/raft.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -94,15 +94,15 @@ time. To use Raft for HA coordination users must also use Raft for storage.
still need to be unsealed manually. See the section below that describes the
parameters accepted by the `retry_join` stanza.

- `max_entry_size` `(integer: 1572864)` - This configures the maximum number of
- `max_entry_size` `(integer: 1048576)` - This configures the maximum number of
bytes for a raft entry. It applies to both Put operations and transactions.
Any put or transaction operation exceeding this configuration value will cause
the respective operation to fail. Raft has a suggested max size of data in a
raft log entry. This is based on current architecture, default timing, etc.
Integrated storage also uses a chunk size that is the threshold used for
breaking a large value into chunks. By default, the chunk size is the same as
raft's max size log entry. The default value for this configuration is 1572864
-- three times the chunking size.
raft's max size log entry. The default value for this configuration is 1048576
-- two times the chunking size.

### `retry_join` stanza

Expand Down

0 comments on commit 5c71cfb

Please sign in to comment.