From e8b5d55d9d060b9b187824ff13c33134c51e1929 Mon Sep 17 00:00:00 2001 From: Victor Castell Date: Wed, 1 May 2019 23:10:28 +0200 Subject: [PATCH] Implement server selection using consistent hash (#522) * Implement server selection using consistent hash Server selection via consistent hash over peer members, ensures a good request distribution and mimics a cache store. * fix: Do not reply events on join. This could lead to unpredictable job executions out of time * refactor: To use GetExecutons in GetExecutionsGroup --- dkron/agent.go | 32 +++++- dkron/api.go | 2 +- dkron/invoke.go | 31 ++---- dkron/store.go | 20 ++-- go.mod | 2 +- proto/dkron.pb.go | 141 +++++++++++++++++---------- proto/dkron.proto | 4 + website/content/pro/executors/ecs.md | 4 +- 8 files changed, 147 insertions(+), 89 deletions(-) diff --git a/dkron/agent.go b/dkron/agent.go index 70128dd2e..14986273d 100644 --- a/dkron/agent.go +++ b/dkron/agent.go @@ -37,6 +37,7 @@ var ( runningExecutions sync.Map ) +// Agent is the main struct that represents a dkron agent type Agent struct { ProcessorPlugins map[string]ExecutionProcessor ExecutorPlugins map[string]Executor @@ -45,6 +46,9 @@ type Agent struct { GRPCServer DkronGRPCServer GRPCClient DkronGRPCClient + // Set a global peer updater func + PeerUpdaterFunc func(...string) + serf *serf.Serf config *Config eventCh chan serf.Event @@ -79,7 +83,7 @@ func (a *Agent) Start() error { return fmt.Errorf("agent: Can not setup serf, %s", err) } a.serf = s - a.join(a.config.StartJoin, true) + a.join(a.config.StartJoin, false) if err := initMetrics(a); err != nil { log.Fatal("agent: Can not setup metrics") @@ -396,7 +400,8 @@ func (a *Agent) leaderMember() (*serf.Member, error) { return nil, ErrLeaderNotFound } -func (a *Agent) listServers() []serf.Member { +// ListServers returns the list of server members +func (a *Agent) ListServers() []serf.Member { members := []serf.Member{} for _, member := range a.serf.Members() { @@ -409,6 +414,11 @@ func (a *Agent) listServers() []serf.Member { return members } +// LocalMember return the local serf member +func (a *Agent) LocalMember() serf.Member { + return a.serf.LocalMember() +} + // GetBindIP returns the IP address that the agent is bound to. // This could be different than the originally configured address. func (a *Agent) GetBindIP() (string, error) { @@ -416,6 +426,19 @@ func (a *Agent) GetBindIP() (string, error) { return bindIP, err } +// GetPeers returns a list of the current serf servers peers addresses +func (a *Agent) GetPeers() (peers []string) { + s := a.ListServers() + for _, m := range s { + if addr, ok := m.Tags["dkron_rpc_addr"]; ok { + peers = append(peers, addr) + log.WithField("peer", addr).Debug("agent: updated peer") + } + } + + return +} + // Listens to events from Serf and handle the event. func (a *Agent) eventLoop() { serfShutdownCh := a.serf.ShutdownCh() @@ -437,6 +460,11 @@ func (a *Agent) eventLoop() { "event": e.EventType(), }).Debug("agent: Member event") } + + //In case of member event update peer list + if a.PeerUpdaterFunc != nil { + a.PeerUpdaterFunc(a.GetPeers()...) + } } if e.EventType() == serf.EventQuery { diff --git a/dkron/api.go b/dkron/api.go index 6b5872c62..40423da1a 100644 --- a/dkron/api.go +++ b/dkron/api.go @@ -238,7 +238,7 @@ func (h *HTTPTransport) leaderHandler(c *gin.Context) { func (h *HTTPTransport) leaveHandler(c *gin.Context) { if err := h.agent.Stop(); err != nil { - renderJSON(c, http.StatusOK, h.agent.listServers()) + renderJSON(c, http.StatusOK, h.agent.ListServers()) } } diff --git a/dkron/invoke.go b/dkron/invoke.go index bf4b2786b..98110204d 100644 --- a/dkron/invoke.go +++ b/dkron/invoke.go @@ -2,11 +2,10 @@ package dkron import ( "errors" - "math/rand" "time" "github.com/armon/circbuf" - "github.com/hashicorp/serf/serf" + "github.com/golang/groupcache/consistenthash" ) const ( @@ -61,33 +60,23 @@ func (a *Agent) invokeJob(job *Job, execution *Execution) error { execution.Success = success execution.Output = output.Bytes() - rpcServer, err := a.getServerRPCAddresFromTags() + rpcServer, err := a.selectServerByKey(execution.Key()) if err != nil { return err } + log.WithField("server", rpcServer).Debug("invoke: Selected a server to send result") runningExecutions.Delete(execution.GetGroup()) return a.GRPCClient.CallExecutionDone(rpcServer, execution) } -func (a *Agent) selectServer() serf.Member { - var server serf.Member +// Select a server based on key using a consistent hash key +// like a cache store. +func (a *Agent) selectServerByKey(key string) (string, error) { + ch := consistenthash.New(50, nil) + ch.Add(a.GetPeers()...) + peerAddress := ch.Get(key) - servers := a.listServers() - - if len(servers) > 0 { - server = servers[rand.Intn(len(servers))] - } - - return server -} - -func (a *Agent) getServerRPCAddresFromTags() (string, error) { - s := a.selectServer() - - if addr, ok := s.Tags["dkron_rpc_addr"]; ok { - return addr, nil - } - return "", ErrNoRPCAddress + return peerAddress, nil } diff --git a/dkron/store.go b/dkron/store.go index 54c4a545b..6807e2c36 100644 --- a/dkron/store.go +++ b/dkron/store.go @@ -385,22 +385,17 @@ func (s *Store) GetLastExecutionGroup(jobName string) ([]*Execution, error) { return executions, nil } +// GetExecutionGroup returns all executions in the same group of a given execution func (s *Store) GetExecutionGroup(execution *Execution) ([]*Execution, error) { - res, err := s.client.List(fmt.Sprintf("%s/executions/%s", s.keyspace, execution.JobName), nil) + res, err := s.GetExecutions(execution.JobName) if err != nil { return nil, err } var executions []*Execution - for _, node := range res { - var ex Execution - err := json.Unmarshal([]byte(node.Value), &ex) - if err != nil { - return nil, err - } - + for _, ex := range res { if ex.Group == execution.Group { - executions = append(executions, &ex) + executions = append(executions, ex) } } return executions, nil @@ -428,9 +423,9 @@ func (s *Store) GetGroupedExecutions(jobName string) (map[int64][]*Execution, [] return groups, byGroup, nil } -// Save a new execution and returns the key of the new saved item or an error. +// SetExecution Save a new execution and returns the key of the new saved item or an error. func (s *Store) SetExecution(execution *Execution) (string, error) { - exJson, _ := json.Marshal(execution) + exJSON, _ := json.Marshal(execution) key := execution.Key() log.WithFields(logrus.Fields{ @@ -438,7 +433,7 @@ func (s *Store) SetExecution(execution *Execution) (string, error) { "execution": key, }).Debug("store: Setting key") - err := s.client.Put(fmt.Sprintf("%s/executions/%s/%s", s.keyspace, execution.JobName, key), exJson, nil) + err := s.client.Put(fmt.Sprintf("%s/executions/%s/%s", s.keyspace, execution.JobName, key), exJSON, nil) if err != nil { log.WithFields(logrus.Fields{ "job": execution.JobName, @@ -458,6 +453,7 @@ func (s *Store) SetExecution(execution *Execution) (string, error) { // Delete all execution results over the limit, starting from olders if len(execs) > MaxExecutions { //sort the array of all execution groups by StartedAt time + // TODO: Use sort.Slice sort.Sort(ExecList(execs)) for i := 0; i < len(execs)-MaxExecutions; i++ { log.WithFields(logrus.Fields{ diff --git a/go.mod b/go.mod index 21568264d..07a807d9c 100644 --- a/go.mod +++ b/go.mod @@ -21,7 +21,7 @@ require ( github.com/gin-contrib/multitemplate v0.0.0-20170922032617-bbc6daf6024b github.com/gin-contrib/sse v0.0.0-20170109093832-22d885f9ecc7 // indirect github.com/gin-gonic/gin v1.3.0 - github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff // indirect + github.com/golang/groupcache v0.0.0-20181024230925-c65c006176ff github.com/golang/protobuf v1.2.0 github.com/gorilla/websocket v1.4.0 // indirect github.com/grpc-ecosystem/go-grpc-middleware v1.0.0 // indirect diff --git a/proto/dkron.pb.go b/proto/dkron.pb.go index 1e878ecde..314edd88e 100644 --- a/proto/dkron.pb.go +++ b/proto/dkron.pb.go @@ -36,7 +36,7 @@ func (m *GetJobRequest) Reset() { *m = GetJobRequest{} } func (m *GetJobRequest) String() string { return proto.CompactTextString(m) } func (*GetJobRequest) ProtoMessage() {} func (*GetJobRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dkron_53e25a55b3cc2668, []int{0} + return fileDescriptor_dkron_67bd9a70655d75e0, []int{0} } func (m *GetJobRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetJobRequest.Unmarshal(m, b) @@ -89,7 +89,7 @@ func (m *GetJobResponse) Reset() { *m = GetJobResponse{} } func (m *GetJobResponse) String() string { return proto.CompactTextString(m) } func (*GetJobResponse) ProtoMessage() {} func (*GetJobResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dkron_53e25a55b3cc2668, []int{1} + return fileDescriptor_dkron_67bd9a70655d75e0, []int{1} } func (m *GetJobResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_GetJobResponse.Unmarshal(m, b) @@ -239,7 +239,7 @@ func (m *ExecutionDoneRequest) Reset() { *m = ExecutionDoneRequest{} } func (m *ExecutionDoneRequest) String() string { return proto.CompactTextString(m) } func (*ExecutionDoneRequest) ProtoMessage() {} func (*ExecutionDoneRequest) Descriptor() ([]byte, []int) { - return fileDescriptor_dkron_53e25a55b3cc2668, []int{2} + return fileDescriptor_dkron_67bd9a70655d75e0, []int{2} } func (m *ExecutionDoneRequest) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ExecutionDoneRequest.Unmarshal(m, b) @@ -327,7 +327,7 @@ func (m *ExecutionDoneResponse) Reset() { *m = ExecutionDoneResponse{} } func (m *ExecutionDoneResponse) String() string { return proto.CompactTextString(m) } func (*ExecutionDoneResponse) ProtoMessage() {} func (*ExecutionDoneResponse) Descriptor() ([]byte, []int) { - return fileDescriptor_dkron_53e25a55b3cc2668, []int{3} + return fileDescriptor_dkron_67bd9a70655d75e0, []int{3} } func (m *ExecutionDoneResponse) XXX_Unmarshal(b []byte) error { return xxx_messageInfo_ExecutionDoneResponse.Unmarshal(m, b) @@ -361,6 +361,44 @@ func (m *ExecutionDoneResponse) GetPayload() []byte { return nil } +type Executions struct { + Executions []*ExecutionDoneRequest `protobuf:"bytes,1,rep,name=executions,proto3" json:"executions,omitempty"` + XXX_NoUnkeyedLiteral struct{} `json:"-"` + XXX_unrecognized []byte `json:"-"` + XXX_sizecache int32 `json:"-"` +} + +func (m *Executions) Reset() { *m = Executions{} } +func (m *Executions) String() string { return proto.CompactTextString(m) } +func (*Executions) ProtoMessage() {} +func (*Executions) Descriptor() ([]byte, []int) { + return fileDescriptor_dkron_67bd9a70655d75e0, []int{4} +} +func (m *Executions) XXX_Unmarshal(b []byte) error { + return xxx_messageInfo_Executions.Unmarshal(m, b) +} +func (m *Executions) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) { + return xxx_messageInfo_Executions.Marshal(b, m, deterministic) +} +func (dst *Executions) XXX_Merge(src proto.Message) { + xxx_messageInfo_Executions.Merge(dst, src) +} +func (m *Executions) XXX_Size() int { + return xxx_messageInfo_Executions.Size(m) +} +func (m *Executions) XXX_DiscardUnknown() { + xxx_messageInfo_Executions.DiscardUnknown(m) +} + +var xxx_messageInfo_Executions proto.InternalMessageInfo + +func (m *Executions) GetExecutions() []*ExecutionDoneRequest { + if m != nil { + return m.Executions + } + return nil +} + func init() { proto.RegisterType((*GetJobRequest)(nil), "proto.GetJobRequest") proto.RegisterType((*GetJobResponse)(nil), "proto.GetJobResponse") @@ -368,6 +406,7 @@ func init() { proto.RegisterMapType((map[string]string)(nil), "proto.GetJobResponse.TagsEntry") proto.RegisterType((*ExecutionDoneRequest)(nil), "proto.ExecutionDoneRequest") proto.RegisterType((*ExecutionDoneResponse)(nil), "proto.ExecutionDoneResponse") + proto.RegisterType((*Executions)(nil), "proto.Executions") } // Reference imports to suppress errors if they are not otherwise used. @@ -508,50 +547,52 @@ var _Dkron_serviceDesc = grpc.ServiceDesc{ Metadata: "dkron.proto", } -func init() { proto.RegisterFile("dkron.proto", fileDescriptor_dkron_53e25a55b3cc2668) } - -var fileDescriptor_dkron_53e25a55b3cc2668 = []byte{ - // 668 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x5d, 0x4f, 0xdb, 0x30, - 0x14, 0x55, 0x28, 0x29, 0xed, 0xed, 0x07, 0xcc, 0x14, 0xe4, 0x85, 0x4d, 0x44, 0x9d, 0x26, 0x75, - 0x7b, 0x28, 0x12, 0x68, 0x62, 0x1f, 0x4f, 0x08, 0xaa, 0x49, 0xd5, 0xb4, 0x87, 0x88, 0xf7, 0xca, - 0x49, 0x6e, 0x4b, 0xa0, 0xb5, 0x33, 0xdb, 0x61, 0xeb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4, 0x9d, 0x8b, 0x48, 0xef, - 0x81, 0xa9, 0xec, 0x13, 0x04, 0x7b, 0x6b, 0xad, 0x46, 0xc6, 0xd0, 0xb9, 0x77, 0x0f, 0x72, 0x50, - 0xea, 0xd6, 0xbd, 0x63, 0xf0, 0x6c, 0x7d, 0xb2, 0xac, 0x75, 0x0a, 0xfe, 0x27, 0x64, 0xb7, 0x48, - 0xf6, 0xff, 0x1a, 0xc2, 0xc8, 0x7c, 0x04, 0x83, 0x7f, 0xf0, 0x71, 0xdd, 0xe2, 0x93, 0xdf, 0x01, - 0x00, 0x00, 0xff, 0xff, 0x14, 0x0c, 0x54, 0x28, 0x71, 0x05, 0x00, 0x00, +func init() { proto.RegisterFile("dkron.proto", fileDescriptor_dkron_67bd9a70655d75e0) } + +var fileDescriptor_dkron_67bd9a70655d75e0 = []byte{ + // 690 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0x94, 0x54, 0x5d, 0x4f, 0xdb, 0x4a, + 0x10, 0x95, 0x09, 0x0e, 0xc9, 0xe4, 0x03, 0xee, 0x12, 0xd0, 0x5e, 0x73, 0xaf, 0xb0, 0x72, 0x75, + 0xa5, 0xb4, 0x0f, 0x41, 0x02, 0x55, 0xb4, 0xe5, 0x09, 0x41, 0x54, 0x35, 0xaa, 0xfa, 0x60, 0xf1, + 0x1e, 0xad, 0xed, 0x49, 0x30, 0x24, 0xbb, 0xee, 0xee, 0x9a, 0x36, 0xfd, 0x45, 0x7d, 0xec, 0x7f, + 0xe8, 0x1f, 0xab, 0x76, 0xd7, 0x4e, 0x81, 0xa6, 0x45, 0x7d, 0xca, 0x9e, 0x33, 0x67, 0x67, 0x32, + 0xb3, 0x67, 0x0c, 0xad, 0xf4, 0x56, 0x0a, 0x3e, 0xcc, 0xa5, 0xd0, 0x82, 0xf8, 0xf6, 0x27, 0x38, + 0x9c, 0x09, 0x31, 0x9b, 0xe3, 0x91, 0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fc, 0xb3, 0x3e, 0x58, 0xe6, 0x3a, + 0x05, 0xff, 0x1d, 0xb2, 0x3b, 0x24, 0xfb, 0x3f, 0xcd, 0x73, 0x64, 0xbe, 0xa7, 0xc1, 0x2f, 0xf8, + 0xb8, 0x6e, 0xf1, 0xc9, 0xf7, 0x00, 0x00, 0x00, 0xff, 0xff, 0x5d, 0xe0, 0xe3, 0x81, 0xbc, 0x05, + 0x00, 0x00, } diff --git a/proto/dkron.proto b/proto/dkron.proto index d2051bc9b..471bc00e3 100644 --- a/proto/dkron.proto +++ b/proto/dkron.proto @@ -45,6 +45,10 @@ message ExecutionDoneResponse { bytes payload = 2; } +message Executions { + repeated ExecutionDoneRequest executions = 1; +} + service Dkron { rpc GetJob (GetJobRequest) returns (GetJobResponse); rpc ExecutionDone (ExecutionDoneRequest) returns (ExecutionDoneResponse); diff --git a/website/content/pro/executors/ecs.md b/website/content/pro/executors/ecs.md index 38b9b315a..d0af13513 100644 --- a/website/content/pro/executors/ecs.md +++ b/website/content/pro/executors/ecs.md @@ -60,7 +60,7 @@ Example using a provided taskdef "cluster": "default", "fargate": "yes", "env": "ENVIRONMENT=variable", - "maxAttempts": 5000 + "maxAttempts": "5000" } } ``` @@ -79,5 +79,5 @@ subnet env service overrides -maxAttempts // Defaults to 2000, with 6s delay between it will wait up to 600s +maxAttempts // Defaults to 2000, will perform a check every 6s * 2000 times waiting a total of 12000s or 3.3h ```