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

bug fix: check pending learner before promote in rule checker #18

Open
wants to merge 30 commits into
base: enable-placementrule
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
6d0aa71
client: rename GetMemberInfo to GetAllMembers (#3029)
HunDunDM Sep 25, 2020
0e9a678
tso: use sync.RWMutex to control concurrent reading and writing (#3016)
JmPotato Sep 25, 2020
427dd4c
tso: add SyncMaxTS RPC method (#2988)
JmPotato Sep 27, 2020
adc0dd8
tools: enhance the pd-tso-bench (#3032)
JmPotato Sep 27, 2020
458b7ae
pdctl: add state filter support in store command (#3018)
lizhemingi Sep 28, 2020
177f8f8
api: add check learner-peer API (#3036)
rleungx Sep 28, 2020
84dde98
api: reduce duplicated functions (#3040)
rleungx Sep 28, 2020
7661eae
config: unify the redact log configuration with tikv (#3037)
Yisaer Sep 28, 2020
4199e72
cluster: check if region is valid before handling it (#3041)
rleungx Sep 29, 2020
a5d1b1e
scheduler: support regions relocating by range (#3028)
Yisaer Sep 29, 2020
a4ab63c
server: move heartbeat test to heartbeat package (#3010)
disksing Sep 30, 2020
43baea9
tso: add election priority for Local TSO Allocator (#2953)
JmPotato Sep 30, 2020
9ed9111
scheduler: Add auto-gc for Region Scatter (#3038)
longfangsong Oct 7, 2020
f0b0d97
metrics: add heartbeat interval and distribution of region bytes, key…
lhy1024 Oct 9, 2020
90a934a
tso: Support configuring tso update physical interval (#3027)
MyonKeminta Oct 9, 2020
858ef8c
api: add status query parameter for the scheduler API (#3055)
rleungx Oct 10, 2020
4331304
api: Add scatter regions http api (#3051)
Yisaer Oct 10, 2020
2d1adee
Bug fix
ZenoTan Oct 10, 2020
6a418ce
security: Encrypt region boundary keys, Part 2 - server changes (#2976)
Oct 11, 2020
0c935f9
Address comment
ZenoTan Oct 12, 2020
f73cd4b
Merge branch 'master' of https://github.com/pingcap/pd into learn
ZenoTan Oct 12, 2020
37dbd4c
Fix
ZenoTan Oct 12, 2020
0adcfe0
Fix ci
ZenoTan Oct 12, 2020
8558f34
api: auto fill group id in rules when unset (#3061)
lizhemingi Oct 13, 2020
e0747f9
tso: implement the global TSO generation algorithm (#3033)
JmPotato Oct 14, 2020
d6010f9
Merge branch 'master' into learn
ZenoTan Oct 14, 2020
d12132d
Use unhealthy
ZenoTan Oct 14, 2020
c3dc06b
Merge branch 'learn' of https://github.com/ZenoTan/pd into learn
ZenoTan Oct 14, 2020
055a5f5
fix
ZenoTan Oct 14, 2020
3ff4b5c
Change func name
ZenoTan Oct 14, 2020
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 client/base_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ func (c *baseClient) getOrCreateGRPCConn(addr string) (*grpc.ClientConn, error)
if ok {
return conn, nil
}
tlsCfg, err := grpcutil.SecurityConfig{
tlsCfg, err := grpcutil.TLSConfig{
CAPath: c.security.CAPath,
CertPath: c.security.CertPath,
KeyPath: c.security.KeyPath,
Expand Down
14 changes: 7 additions & 7 deletions client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ type Region struct {
type Client interface {
// GetClusterID gets the cluster ID from PD.
GetClusterID(ctx context.Context) uint64
// GetMemberInfo gets the members Info from PD
GetMemberInfo(ctx context.Context) ([]*pdpb.Member, error)
// GetAllMembers gets the members Info from PD
GetAllMembers(ctx context.Context) ([]*pdpb.Member, error)
// GetLeaderAddr returns current leader's address. It returns "" before
// syncing leader from server.
GetLeaderAddr() string
Expand Down Expand Up @@ -221,17 +221,17 @@ func (c *client) checkStreamTimeout(loopCtx context.Context, cancel context.Canc
}
}

func (c *client) GetMemberInfo(ctx context.Context) ([]*pdpb.Member, error) {
func (c *client) GetAllMembers(ctx context.Context) ([]*pdpb.Member, error) {
start := time.Now()
defer func() { cmdDurationGetMemberInfo.Observe(time.Since(start).Seconds()) }()
defer func() { cmdDurationGetAllMembers.Observe(time.Since(start).Seconds()) }()

ctx, cancel := context.WithTimeout(ctx, c.timeout)
resp, err := c.leaderClient().GetMembers(ctx, &pdpb.GetMembersRequest{
Header: c.requestHeader(),
})
cancel()
if err != nil {
cmdFailDurationGetMemberInfo.Observe(time.Since(start).Seconds())
cmdFailDurationGetAllMembers.Observe(time.Since(start).Seconds())
c.ScheduleCheckLeader()
return nil, errors.WithStack(err)
}
Expand Down Expand Up @@ -371,8 +371,8 @@ func (c *client) processTSORequests(stream pdpb.PD_TsoClient, requests []*tsoReq
// Server returns the highest ts.
logical -= int64(resp.GetCount() - 1)
if tsLessEqual(physical, logical, c.lastPhysical, c.lastLogical) {
panic(errors.Errorf("timestamp fallback, newly acquired ts (%d,%d) is less or equal to last one (%d, %d)",
physical, logical, c.lastLogical, c.lastLogical))
panic(errors.Errorf("timestamp fallback, newly acquired ts (%d, %d) is less or equal to last one (%d, %d)",
physical, logical, c.lastPhysical, c.lastLogical))
}
c.lastPhysical = physical
c.lastLogical = logical + int64(len(requests)) - 1
Expand Down
4 changes: 2 additions & 2 deletions client/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ var (
cmdDurationTSO = cmdDuration.WithLabelValues("tso")
cmdDurationTSOAsyncWait = cmdDuration.WithLabelValues("tso_async_wait")
cmdDurationGetRegion = cmdDuration.WithLabelValues("get_region")
cmdDurationGetMemberInfo = cmdDuration.WithLabelValues("get_member_info")
cmdDurationGetAllMembers = cmdDuration.WithLabelValues("get_member_info")
cmdDurationGetPrevRegion = cmdDuration.WithLabelValues("get_prev_region")
cmdDurationGetRegionByID = cmdDuration.WithLabelValues("get_region_byid")
cmdDurationScanRegions = cmdDuration.WithLabelValues("scan_regions")
Expand All @@ -72,7 +72,7 @@ var (

cmdFailDurationGetRegion = cmdFailedDuration.WithLabelValues("get_region")
cmdFailDurationTSO = cmdFailedDuration.WithLabelValues("tso")
cmdFailDurationGetMemberInfo = cmdFailedDuration.WithLabelValues("get_member_info")
cmdFailDurationGetAllMembers = cmdFailedDuration.WithLabelValues("get_member_info")
cmdFailDurationGetPrevRegion = cmdFailedDuration.WithLabelValues("get_prev_region")
cmdFailedDurationGetRegionByID = cmdFailedDuration.WithLabelValues("get_region_byid")
cmdFailedDurationScanRegions = cmdFailedDuration.WithLabelValues("scan_regions")
Expand Down
47 changes: 47 additions & 0 deletions conf/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,53 @@ key-path = ""

cert-allowed-cn = ["example.com"]

[security.encryption]
## Encryption method to use for PD data. One of "plaintext", "aes128-ctr", "aes192-ctr" and "aes256-ctr".
## Defaults to "plaintext" if not set.
# data-encryption-method = "plaintext"
## Specifies how often PD rotates data encryption key. Default is 7 days.
# data-key-rotation-period = "168h"

## Specifies master key if encryption is enabled. There are three types of master key:
##
## * "plaintext":
##
## Plaintext as master key means no master key is given and only applicable when
## encryption is not enabled, i.e. data-encryption-method = "plaintext". This type doesn't
## have sub-config items. Example:
##
## [security.encryption.master-key]
## type = "plaintext"
##
## * "kms":
##
## Use a KMS service to supply master key. Currently only AWS KMS is supported. This type of
## master key is recommended for production use. Example:
##
## [security.encryption.master-key]
## type = "kms"
## ## KMS CMK key id. Must be a valid KMS CMK where the TiKV process has access to.
## ## In production is recommended to grant access of the CMK to TiKV using IAM.
## key-id = "1234abcd-12ab-34cd-56ef-1234567890ab"
## ## AWS region of the KMS CMK.
## region = "us-west-2"
## ## (Optional) AWS KMS service endpoint. Only required when non-default KMS endpoint is
## ## desired.
## endpoint = "https://kms.us-west-2.amazonaws.com"
##
## * "file":
##
## Supply a custom encryption key stored in a file. It is recommended NOT to use in production,
## as it breaks the purpose of encryption at rest, unless the file is stored in tempfs.
## The file must contain a 256-bits (32 bytes, regardless of key length implied by
## data-encryption-method) key encoded as hex string and end with newline ("\n"). Example:
##
## [security.encryption.master-key]
## type = "file"
## path = "/path/to/master/key/file"
# [security.encryption.master-key]
# type = "plaintext"

[log]
level = "info"

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ require (
github.com/pingcap/errcode v0.0.0-20180921232412-a1a7271709d9
github.com/pingcap/errors v0.11.5-0.20200917111840-a15ef68f753d
github.com/pingcap/failpoint v0.0.0-20191029060244-12f4ac2fd11d
github.com/pingcap/kvproto v0.0.0-20200916031750-f9473f2c5379
github.com/pingcap/kvproto v0.0.0-20200927025644-73dc27044686
github.com/pingcap/log v0.0.0-20200511115504-543df19646ad
github.com/pingcap/sysutil v0.0.0-20200715082929-4c47bcac246a
github.com/prometheus/client_golang v1.0.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -300,8 +300,8 @@ github.com/pingcap/failpoint v0.0.0-20191029060244-12f4ac2fd11d h1:F8vp38kTAckN+
github.com/pingcap/failpoint v0.0.0-20191029060244-12f4ac2fd11d/go.mod h1:DNS3Qg7bEDhU6EXNHF+XSv/PGznQaMJ5FWvctpm6pQI=
github.com/pingcap/kvproto v0.0.0-20191211054548-3c6b38ea5107/go.mod h1:WWLmULLO7l8IOcQG+t+ItJ3fEcrL5FxF0Wu+HrMy26w=
github.com/pingcap/kvproto v0.0.0-20200411081810-b85805c9476c/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
github.com/pingcap/kvproto v0.0.0-20200916031750-f9473f2c5379 h1:KAGE4PYxYLL/dnui3sRCcQHNpcpP5aMl0R/NKzATGgI=
github.com/pingcap/kvproto v0.0.0-20200916031750-f9473f2c5379/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
github.com/pingcap/kvproto v0.0.0-20200927025644-73dc27044686 h1:cf7TL5LMMPQew7vPOtvcfam6AyYxwu5uzcOrHMN8z7k=
github.com/pingcap/kvproto v0.0.0-20200927025644-73dc27044686/go.mod h1:IOdRDPLyda8GX2hE/jO7gqaCV/PNFh8BZQCQZXfIOqI=
github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9 h1:AJD9pZYm72vMgPcQDww9rkZ1DnWfl0pXV3BOWlkYIjA=
github.com/pingcap/log v0.0.0-20191012051959-b742a5d432e9/go.mod h1:4rbK1p9ILyIfb6hU7OG2CiWSqMXnp3JMbiaVJ6mvoY8=
github.com/pingcap/log v0.0.0-20200117041106-d28c14d3b1cd h1:CV3VsP3Z02MVtdpTMfEgRJ4T9NGgGTxdHpJerent7rM=
Expand Down
Loading