Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: compilation on 32bit #8895

Merged
merged 2 commits into from
Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion worker/queue.go
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@ func (t *tasks) cleanup() {
func (t *tasks) newId() uint64 {
myRaftId := State.WALstore.Uint(raftwal.RaftId)
for {
id := myRaftId<<32 | uint64(t.rng.Intn(math.MaxUint32))
id := myRaftId<<32 | uint64(t.rng.Uint32())
// z.Tree cannot store 0 or math.MaxUint64. Check that id is unique.
if id != 0 && id != math.MaxUint64 && t.log.Get(id) == 0 {
return id
Expand Down
3 changes: 2 additions & 1 deletion worker/restore_reduce.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import (
"encoding/binary"
"io"
"log"
"math"
"os"
"path/filepath"
"sort"
Expand All @@ -36,7 +37,7 @@ import (
)

const (
mapFileSz int = 2 << 30
mapFileSz int = math.MaxInt32
partitionBufSz int = 4 << 20
)

Expand Down
2 changes: 1 addition & 1 deletion xidmap/trie.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ type Trie struct {
// NewTrie would return back a Trie backed by the provided Arena. Trie would assume ownership of the
// Arena. Release must be called at the end to release Arena's resources.
func NewTrie() *Trie {
buf := z.NewBuffer(32<<20, "Trie").WithMaxSize(math.MaxUint32)
buf := z.NewBuffer(32<<20, "Trie").WithMaxSize(math.MaxInt32)
// Add additional 8 bytes at the start, because offset=0 is used for checking non-existing node.
// Therefore we can't keep root at 0 offset.
ro := buf.AllocateOffset(nodeSz + 8)
Expand Down