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

Update PD Config to v3.1.0 #1928

Merged
merged 12 commits into from
Mar 23, 2020
Merged
Show file tree
Hide file tree
Changes from 8 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
64 changes: 60 additions & 4 deletions docs/api-references/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -4355,7 +4355,20 @@ <h3 id="pingcap.com/v1alpha1.PDReplicationConfig">PDReplicationConfig
<td>
<em>(Optional)</em>
<p>StrictlyMatchLabel strictly checks if the label of TiKV is matched with LocaltionLabels.
Immutable, change should be made through pd-ctl after cluster creation</p>
Immutable, change should be made through pd-ctl after cluster creation.
Imported from v3.1.0</p>
</td>
</tr>
<tr>
<td>
<code>enable-placement-rules,string</code></br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>When PlacementRules feature is enabled. MaxReplicas and LocationLabels are not uesd any more.</p>
</td>
</tr>
</tbody>
Expand Down Expand Up @@ -4486,8 +4499,9 @@ <h3 id="pingcap.com/v1alpha1.PDScheduleConfig">PDScheduleConfig
<td>
<em>(Optional)</em>
<p>LeaderScheduleLimit is the max coexist leader schedules.
Immutable, change should be made through pd-ctl after cluster creation
Optional: Defaults to 4</p>
Immutable, change should be made through pd-ctl after cluster creation.
Optional: Defaults to 4.
Imported from v3.1.0</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -4571,7 +4585,8 @@ <h3 id="pingcap.com/v1alpha1.PDScheduleConfig">PDScheduleConfig
<td>
<em>(Optional)</em>
<p>TolerantSizeRatio is the ratio of buffer size for balance scheduler.
Immutable, change should be made through pd-ctl after cluster creation</p>
Immutable, change should be made through pd-ctl after cluster creation.
Imported from v3.1.0</p>
</td>
</tr>
<tr>
Expand Down Expand Up @@ -4731,6 +4746,33 @@ <h3 id="pingcap.com/v1alpha1.PDScheduleConfig">PDScheduleConfig
<p>Only used to display</p>
</td>
</tr>
<tr>
<td>
<code>enable-one-way-merge,string</code></br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>EnableOneWayMerge is the option to enable one way merge. This means a Region can only be merged into the next region of it.
Imported from v3.1.0</p>
</td>
</tr>
<tr>
<td>
<code>enable-cross-table-merge,string</code></br>
<em>
bool
</em>
</td>
<td>
<em>(Optional)</em>
<p>EnableCrossTableMerge is the option to enable cross table merge. This means two Regions can be merged with different table IDs.
This option only works when key type is &ldquo;table&rdquo;.
Imported from v3.1.0</p>
</td>
</tr>
</tbody>
</table>
<h3 id="pingcap.com/v1alpha1.PDSchedulerConfig">PDSchedulerConfig
Expand Down Expand Up @@ -4876,6 +4918,20 @@ <h3 id="pingcap.com/v1alpha1.PDServerConfig">PDServerConfig
<p>UseRegionStorage enables the independent region storage.</p>
</td>
</tr>
<tr>
<td>
<code>metric-storage</code></br>
<em>
string
</em>
</td>
<td>
<em>(Optional)</em>
<p>MetricStorage is the cluster metric storage.
Currently we use prometheus as metric storage, we may use PD/TiKV as metric storage later.
Imported from v3.1.0</p>
</td>
</tr>
</tbody>
</table>
<h3 id="pingcap.com/v1alpha1.PDSpec">PDSpec
Expand Down
28 changes: 25 additions & 3 deletions manifests/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1443,6 +1443,11 @@ spec:
pd-server:
description: PDServerConfig is the configuration for pd server.
properties:
metric-storage:
description: MetricStorage is the cluster metric storage.
Currently we use prometheus as metric storage, we may
use PD/TiKV as metric storage later. Imported from v3.1.0
type: string
use-region-storage:
description: UseRegionStorage enables the independent region
storage.
Expand All @@ -1456,6 +1461,10 @@ spec:
replication:
description: PDReplicationConfig is the replication configuration.
properties:
enable-placement-rules:
description: When PlacementRules feature is enabled. MaxReplicas
and LocationLabels are not uesd any more.
type: string
max-replicas:
description: 'MaxReplicas is the number of replicas for
each region. Immutable, change should be made through
Expand All @@ -1465,7 +1474,8 @@ spec:
strictly-match-label:
description: StrictlyMatchLabel strictly checks if the label
of TiKV is matched with LocaltionLabels. Immutable, change
should be made through pd-ctl after cluster creation
should be made through pd-ctl after cluster creation.
Imported from v3.1.0
type: string
type: object
schedule:
Expand Down Expand Up @@ -1511,6 +1521,17 @@ spec:
Immutable, change should be made through pd-ctl after
cluster creation
type: string
enable-cross-table-merge:
description: EnableCrossTableMerge is the option to enable
cross table merge. This means two Regions can be merged
with different table IDs. This option only works when
key type is "table". Imported from v3.1.0
type: string
enable-one-way-merge:
description: EnableOneWayMerge is the option to enable one
way merge. This means a Region can only be merged into
the next region of it. Imported from v3.1.0
type: string
high-space-ratio:
description: HighSpaceRatio is the highest usage ratio of
store which regraded as high space. High space means there
Expand All @@ -1537,7 +1558,8 @@ spec:
leader-schedule-limit:
description: 'LeaderScheduleLimit is the max coexist leader
schedules. Immutable, change should be made through pd-ctl
after cluster creation Optional: Defaults to 4'
after cluster creation. Optional: Defaults to 4. Imported
from v3.1.0'
format: int64
type: integer
low-space-ratio:
Expand Down Expand Up @@ -1643,7 +1665,7 @@ spec:
tolerant-size-ratio:
description: TolerantSizeRatio is the ratio of buffer size
for balance scheduler. Immutable, change should be made
through pd-ctl after cluster creation
through pd-ctl after cluster creation. Imported from v3.1.0
format: double
type: number
type: object
Expand Down
34 changes: 31 additions & 3 deletions pkg/apis/pingcap/v1alpha1/openapi_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

31 changes: 26 additions & 5 deletions pkg/apis/pingcap/v1alpha1/pd_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import (
// PDConfig is the configuration of pd-server
// +k8s:openapi-gen=true
type PDConfig struct {

// +optional
ForceNewCluster *bool `json:"force-new-cluster,omitempty"`
// Optional: Defaults to true
Expand Down Expand Up @@ -179,9 +178,14 @@ type PDReplicationConfig struct {
// +optional
LocationLabels StringSlice `toml:"location-labels,omitempty" json:"location-labels,omitempty"`
// StrictlyMatchLabel strictly checks if the label of TiKV is matched with LocaltionLabels.
// Immutable, change should be made through pd-ctl after cluster creation
// Immutable, change should be made through pd-ctl after cluster creation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Immutable, change should be made through pd-ctl after cluster creation.
// Immutable, changes should be made through pd-ctl after cluster creation.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto.

// Imported from v3.1.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// Imported from v3.1.0
// Available from PD v3.1.0.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this should be as same as the tidb configuration

// +optional
StrictlyMatchLabel *bool `toml:"strictly-match-label,omitempty" json:"strictly-match-label,string,omitempty"`

// When PlacementRules feature is enabled. MaxReplicas and LocationLabels are not uesd any more.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// When PlacementRules feature is enabled. MaxReplicas and LocationLabels are not uesd any more.
// When PlacementRules feature is enabled, MaxReplicas and LocationLabels are not used anymore.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep the note as same as pd

// +optional
EnablePlacementRules *bool `toml:"enable-placement-rules" json:"enable-placement-rules,string,omitempty"`
}

// PDNamespaceConfig is to overwrite the global setting for specific namespace
Expand Down Expand Up @@ -247,8 +251,9 @@ type PDScheduleConfig struct {
// +optional
MaxStoreDownTime string `toml:"max-store-down-time,omitempty" json:"max-store-down-time,omitempty"`
// LeaderScheduleLimit is the max coexist leader schedules.
// Immutable, change should be made through pd-ctl after cluster creation
// Optional: Defaults to 4
// Immutable, change should be made through pd-ctl after cluster creation.
// Optional: Defaults to 4.
// Imported from v3.1.0
// +optional
LeaderScheduleLimit *uint64 `toml:"leader-schedule-limit,omitempty" json:"leader-schedule-limit,omitempty"`
// RegionScheduleLimit is the max coexist region schedules.
Expand Down Expand Up @@ -278,7 +283,8 @@ type PDScheduleConfig struct {
// +optional
HotRegionCacheHitsThreshold *uint64 `toml:"hot-region-cache-hits-threshold,omitempty" json:"hot-region-cache-hits-threshold,omitempty"`
// TolerantSizeRatio is the ratio of buffer size for balance scheduler.
// Immutable, change should be made through pd-ctl after cluster creation
// Immutable, change should be made through pd-ctl after cluster creation.
// Imported from v3.1.0
// +optional
TolerantSizeRatio *float64 `toml:"tolerant-size-ratio,omitempty" json:"tolerant-size-ratio,omitempty"`
//
Expand Down Expand Up @@ -341,6 +347,16 @@ type PDScheduleConfig struct {
// Only used to display
// +optional
SchedulersPayload map[string]string `toml:"schedulers-payload" json:"schedulers-payload,omitempty"`

// EnableOneWayMerge is the option to enable one way merge. This means a Region can only be merged into the next region of it.
// Imported from v3.1.0
// +optional
EnableOneWayMerge *bool `toml:"enable-one-way-merge" json:"enable-one-way-merge,string,omitempty"`
// EnableCrossTableMerge is the option to enable cross table merge. This means two Regions can be merged with different table IDs.
// This option only works when key type is "table".
// Imported from v3.1.0
// +optional
EnableCrossTableMerge *bool `toml:"enable-cross-table-merge" json:"enable-cross-table-merge,string,omitempty"`
}

type PDSchedulerConfigs []PDSchedulerConfig
Expand Down Expand Up @@ -392,6 +408,11 @@ type PDServerConfig struct {
// UseRegionStorage enables the independent region storage.
// +optional
UseRegionStorage *bool `toml:"use-region-storage,omitempty" json:"use-region-storage,string,omitempty"`
// MetricStorage is the cluster metric storage.
// Currently we use prometheus as metric storage, we may use PD/TiKV as metric storage later.
// Imported from v3.1.0
// +optional
MetricStorage *string `toml:"metric-storage" json:"metric-storage,omitempty"`
}

// +k8s:openapi-gen=true
Expand Down
20 changes: 20 additions & 0 deletions pkg/apis/pingcap/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.