mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
Merge pull request #5890 from jaredeh/32bit
Easy 32bit architecture fixes
This commit is contained in:
commit
474eb1b44b
@ -153,12 +153,12 @@ type Server interface {
|
|||||||
|
|
||||||
// EtcdServer is the production implementation of the Server interface
|
// EtcdServer is the production implementation of the Server interface
|
||||||
type EtcdServer struct {
|
type EtcdServer struct {
|
||||||
// r and inflightSnapshots must be the first elements to keep 64-bit alignment for atomic
|
// inflightSnapshots holds count the number of snapshots currently inflight.
|
||||||
// access to fields
|
inflightSnapshots int64 // must use atomic operations to access; keep 64-bit aligned.
|
||||||
|
appliedIndex uint64 // must use atomic operations to access; keep 64-bit aligned.
|
||||||
// count the number of inflight snapshots.
|
// consistIndex used to hold the offset of current executing entry
|
||||||
// MUST use atomic operation to access this field.
|
// It is initialized to 0 before executing any entry.
|
||||||
inflightSnapshots int64
|
consistIndex consistentIndex // must use atomic operations to access; keep 64-bit aligned.
|
||||||
Cfg *ServerConfig
|
Cfg *ServerConfig
|
||||||
|
|
||||||
readych chan struct{}
|
readych chan struct{}
|
||||||
@ -194,10 +194,6 @@ type EtcdServer struct {
|
|||||||
// compactor is used to auto-compact the KV.
|
// compactor is used to auto-compact the KV.
|
||||||
compactor *compactor.Periodic
|
compactor *compactor.Periodic
|
||||||
|
|
||||||
// consistent index used to hold the offset of current executing entry
|
|
||||||
// It is initialized to 0 before executing any entry.
|
|
||||||
consistIndex consistentIndex
|
|
||||||
|
|
||||||
// peerRt used to send requests (version, lease) to peers.
|
// peerRt used to send requests (version, lease) to peers.
|
||||||
peerRt http.RoundTripper
|
peerRt http.RoundTripper
|
||||||
reqIDGen *idutil.Generator
|
reqIDGen *idutil.Generator
|
||||||
@ -211,8 +207,6 @@ type EtcdServer struct {
|
|||||||
// wg is used to wait for the go routines that depends on the server state
|
// wg is used to wait for the go routines that depends on the server state
|
||||||
// to exit when stopping the server.
|
// to exit when stopping the server.
|
||||||
wg sync.WaitGroup
|
wg sync.WaitGroup
|
||||||
|
|
||||||
appliedIndex uint64
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// NewServer creates a new EtcdServer from the supplied configuration. The
|
// NewServer creates a new EtcdServer from the supplied configuration. The
|
||||||
|
@ -38,7 +38,7 @@ var (
|
|||||||
// SoftState provides state that is useful for logging and debugging.
|
// SoftState provides state that is useful for logging and debugging.
|
||||||
// The state is volatile and does not need to be persisted to the WAL.
|
// The state is volatile and does not need to be persisted to the WAL.
|
||||||
type SoftState struct {
|
type SoftState struct {
|
||||||
Lead uint64
|
Lead uint64 // must use atomic operations to access; keep 64-bit aligned.
|
||||||
RaftState StateType
|
RaftState StateType
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,9 +189,9 @@ func (x *ConfChangeType) UnmarshalJSON(data []byte) error {
|
|||||||
func (ConfChangeType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{2} }
|
func (ConfChangeType) EnumDescriptor() ([]byte, []int) { return fileDescriptorRaft, []int{2} }
|
||||||
|
|
||||||
type Entry struct {
|
type Entry struct {
|
||||||
Type EntryType `protobuf:"varint,1,opt,name=Type,json=type,enum=raftpb.EntryType" json:"Type"`
|
|
||||||
Term uint64 `protobuf:"varint,2,opt,name=Term,json=term" json:"Term"`
|
Term uint64 `protobuf:"varint,2,opt,name=Term,json=term" json:"Term"`
|
||||||
Index uint64 `protobuf:"varint,3,opt,name=Index,json=index" json:"Index"`
|
Index uint64 `protobuf:"varint,3,opt,name=Index,json=index" json:"Index"`
|
||||||
|
Type EntryType `protobuf:"varint,1,opt,name=Type,json=type,enum=raftpb.EntryType" json:"Type"`
|
||||||
Data []byte `protobuf:"bytes,4,opt,name=Data,json=data" json:"Data,omitempty"`
|
Data []byte `protobuf:"bytes,4,opt,name=Data,json=data" json:"Data,omitempty"`
|
||||||
XXX_unrecognized []byte `json:"-"`
|
XXX_unrecognized []byte `json:"-"`
|
||||||
}
|
}
|
||||||
|
@ -15,9 +15,9 @@ enum EntryType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
message Entry {
|
message Entry {
|
||||||
|
optional uint64 Term = 2 [(gogoproto.nullable) = false]; // must be 64-bit aligned for atomic operations
|
||||||
|
optional uint64 Index = 3 [(gogoproto.nullable) = false]; // must be 64-bit aligned for atomic operations
|
||||||
optional EntryType Type = 1 [(gogoproto.nullable) = false];
|
optional EntryType Type = 1 [(gogoproto.nullable) = false];
|
||||||
optional uint64 Term = 2 [(gogoproto.nullable) = false];
|
|
||||||
optional uint64 Index = 3 [(gogoproto.nullable) = false];
|
|
||||||
optional bytes Data = 4;
|
optional bytes Data = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user