Skip to content

Commit

Permalink
fix: 64-bit alignment of 64-bit words accessed atomically
Browse files Browse the repository at this point in the history
  • Loading branch information
buraksezer committed May 1, 2021
1 parent 5485588 commit 8b851ea
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 25 deletions.
2 changes: 1 addition & 1 deletion client/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ func newListener() *listener {
type stream struct {
mu sync.RWMutex

pongReceivedAt int64
listeners map[uint64]*listener
read chan protocol.EncodeDecoder
write chan protocol.EncodeDecoder
pongReceivedAt int64
errCh chan error
ctx context.Context
cancel context.CancelFunc
Expand Down
44 changes: 20 additions & 24 deletions internal/cluster/routingtable/routingtable.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,36 +45,32 @@ type route struct {
type RoutingTable struct {
sync.RWMutex // routingMtx

// These values is useful to control operation status.
bootstrapped int32

updateRoutingMtx sync.Mutex

table map[uint64]*route

// consistent hash ring implementation.
consistent *consistent.Consistent

// numMembers is used to check cluster quorum.
numMembers int32
// Currently owned partition count. Approximate LRU implementation
// uses that.
ownedPartitionCount uint64
signature uint64
this discovery.Member
members *Members
config *config.Config
log *flog.Logger
primary *partitions.Partitions
backup *partitions.Partitions
client *transport.Client
discovery *discovery.Discovery
callbacks []func()
callbackMtx sync.Mutex
updatePeriod time.Duration
ctx context.Context
cancel context.CancelFunc
wg sync.WaitGroup
// These values is useful to control operation status.
bootstrapped int32

updateRoutingMtx sync.Mutex
table map[uint64]*route
consistent *consistent.Consistent
this discovery.Member
members *Members
config *config.Config
log *flog.Logger
primary *partitions.Partitions
backup *partitions.Partitions
client *transport.Client
discovery *discovery.Discovery
callbacks []func()
callbackMtx sync.Mutex
updatePeriod time.Duration
ctx context.Context
cancel context.CancelFunc
wg sync.WaitGroup
}

func New(e *environment.Environment) *RoutingTable {
Expand Down

0 comments on commit 8b851ea

Please sign in to comment.