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

yaml: phase 1 #6070

Merged
merged 16 commits into from
Apr 19, 2020
Merged

yaml: phase 1 #6070

merged 16 commits into from
Apr 19, 2020

Conversation

sougou
Copy link
Contributor

@sougou sougou commented Apr 15, 2020

This implements part of #6068.

db and init still need to be done. TabletConfig has been refactored to match the new specs, and a new flag tablet_config has been added to vttablet. This flag is currently experimental and subject to change.

Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Signed-off-by: Sugu Sougoumarane <[email protected]>
Copy link
Member

@harshit-gangal harshit-gangal left a comment

Choose a reason for hiding this comment

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

Have few questions

  1. Few flags are transformed to yaml config, rest would continue to be used as-is?
  2. If flag is provided and also it is present in yaml config. Is yaml config authoritative?
  3. Is there any new field added in yaml config which does not have a flag?

dbaPool *dbconnpool.ConnectionPool
appDebugParams dbconfigs.Connector
}

// New creates a new Pool. The name is used
// to publish stats only.
func New(env tabletenv.Env, name string, capacity int, prefillParallelism int, timeout, idleTimeout time.Duration) *Pool {
func New(env tabletenv.Env, name string, cfg tabletenv.ConnPoolConfig) *Pool {
Copy link
Member

Choose a reason for hiding this comment

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

nit: New -> NewPool

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a go convention: we should avoid repeating the name of the package within contents of the package: https://blog.golang.org/package-names.

Copy link
Member

Choose a reason for hiding this comment

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

Package name is connpool.
The struct name is Pool. This is still allowed as per the convention :)

conns: connpool.New(env, "", 1, 0, 0, idleTimeout),
conns: connpool.New(env, "", tabletenv.ConnPoolConfig{
Size: 1,
IdleTimeoutSeconds: env.Config().OltpReadPool.IdleTimeoutSeconds,
Copy link
Member

Choose a reason for hiding this comment

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

how is oltpReadPool vs olapReadPool config decided. Which one to pick?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just backward compatible behavior. We need to make a decision.

Comment on lines +143 to +144
currentConfig.OlapReadPool.IdleTimeoutSeconds = currentConfig.OltpReadPool.IdleTimeoutSeconds
currentConfig.TxPool.IdleTimeoutSeconds = currentConfig.OltpReadPool.IdleTimeoutSeconds
Copy link
Member

Choose a reason for hiding this comment

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

will there be plan to use it separately.

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 don't know yet. This code just keeps it backward compatible. We should make a decision on it before making it official.

go/vt/vttablet/tabletserver/tabletenv/config.go Outdated Show resolved Hide resolved
go.mod Outdated
@@ -157,11 +157,13 @@ require (
gopkg.in/mgo.v2 v2.0.0-20160818020120-3f83fa500528 // indirect
gopkg.in/ory-am/dockertest.v3 v3.3.4 // indirect
gopkg.in/square/go-jose.v2 v2.3.1 // indirect
gopkg.in/yaml.v2 v2.2.8
Copy link
Member

Choose a reason for hiding this comment

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

is this used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It got auto-added, but didn't get auto-removed.

Signed-off-by: Sugu Sougoumarane <[email protected]>
@sougou
Copy link
Contributor Author

sougou commented Apr 19, 2020

  1. Few flags are transformed to yaml config, rest would continue to be used as-is?

This is only a start. If we like this, we should look at transitioning all flags to yaml.

  1. If flag is provided and also it is present in yaml config. Is yaml config authoritative?

Yaml is authoritative. It will overwrite command line flags. We want to deprecate command line flags.

  1. Is there any new field added in yaml config which does not have a flag?

Not in this PR, but we'll soon be adding new elements that won't have a command line equivalents.

dbaPool *dbconnpool.ConnectionPool
appDebugParams dbconfigs.Connector
}

// New creates a new Pool. The name is used
// to publish stats only.
func New(env tabletenv.Env, name string, capacity int, prefillParallelism int, timeout, idleTimeout time.Duration) *Pool {
func New(env tabletenv.Env, name string, cfg tabletenv.ConnPoolConfig) *Pool {
Copy link
Member

Choose a reason for hiding this comment

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

Package name is connpool.
The struct name is Pool. This is still allowed as per the convention :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants