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 for #2011 and atomics on 32bit systems. #2012

Merged
merged 1 commit into from
Mar 16, 2021
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
28 changes: 14 additions & 14 deletions server/filestore.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,20 +86,20 @@ type fileStore struct {

// Represents a message store block and its data.
type msgBlock struct {
mu sync.RWMutex
fs *fileStore
mfn string
mfd *os.File
ifn string
ifd *os.File
liwsz int64
index uint64
bytes uint64
msgs uint64
first msgId
last msgId
lwits int64

// Here for 32bit systems and atomic.
first msgId
last msgId
mu sync.RWMutex
fs *fileStore
mfn string
mfd *os.File
ifn string
ifd *os.File
liwsz int64
index uint64
bytes uint64
msgs uint64
lwits int64
lwts int64
llts int64
lrts int64
Expand Down
7 changes: 4 additions & 3 deletions server/jetstream.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,15 @@ type JetStreamAPIStats struct {

// This is for internal accounting for JetStream for this server.
type jetStream struct {
// These are here first because of atomics on 32bit systems.
memReserved int64
storeReserved int64
apiCalls int64
mu sync.RWMutex
srv *Server
config JetStreamConfig
cluster *jetStreamCluster
accounts map[*Account]*jsAccount
memReserved int64
storeReserved int64
apiCalls int64
apiSubs *Sublist
disabled bool
oos bool
Expand Down