Skip to content

Conversation

@matelakat
Copy link

@matelakat matelakat commented Jul 6, 2017

This is the re-based version of #20

In order to be able to re-trigger the CI

vuntz added 3 commits July 6, 2017 11:11
This recipe contains fine-tuning to make sure that postgresql is
configured the correct way on the node is being deployed to (in terms of
memory usage, for instance).

(cherry picked from commit acf6a53)
There are a couple of fixes that we want from
https://github.com/sous-chefs/postgresql/blob/master/recipes/config_pgtune.rb

(cherry picked from commit bc7292280dccd5e89721ec0869fc69662cff096f)
Now that we enable the config_pgtune recipe, the max_connection settings
must live there.

This mostly reverts 251a5de.

(cherry picked from commit 42d14f66336caf0b0d88541f919da3fcef054790)

def downgrade(ta, td, a, d)
if ta["postgresql"]["config"].key?("max_connections")
a["postgresql"]["config"]["max_connections"] = a["postgresql"]["config_pgtune"]["max_connections"]

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [102/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)

def upgrade(ta, td, a, d)
a["postgresql"]["config_pgtune"] ||= {}
unless a["postgresql"]["config_pgtune"].key?("max_connections")
a["postgresql"]["config_pgtune"]["max_connections"] = a["postgresql"]["config"]["max_connections"]

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [102/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)

"dw" => 500,
"mixed" => 100,
"desktop" => 100,
}.fetch(db_type)

Choose a reason for hiding this comment

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

Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.

"oltp" => 100,
"dw" => 500,
"mixed" => 100,
"desktop" => 100,

Choose a reason for hiding this comment

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

Style/TrailingCommaInLiteral: Avoid comma after the last item of a hash. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)

"dw" => "0.9",
"mixed" => "0.9",
"desktop" => "0.5",
}.fetch(db_type)

Choose a reason for hiding this comment

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

Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.

"oltp" => mem / 16,
"dw" => mem / 8,
"mixed" => mem / 16,
"desktop" => mem / 16,

Choose a reason for hiding this comment

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

Style/TrailingCommaInLiteral: Avoid comma after the last item of a hash. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)

"dw" => mem_con_v / 2,
"mixed" => mem_con_v / 2,
"desktop" => mem_con_v / 6,
}.fetch(db_type)

Choose a reason for hiding this comment

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

Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.

"oltp" => mem_con_v,
"dw" => mem_con_v / 2,
"mixed" => mem_con_v / 2,
"desktop" => mem_con_v / 6,

Choose a reason for hiding this comment

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

Style/TrailingCommaInLiteral: Avoid comma after the last item of a hash. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)

}.fetch(db_type)

node.default["postgresql"]["config"]["effective_cache_size"] = binaryround(effective_cache_size*1024*1024)
node.default["postgresql"]["config"]["effective_cache_size"] = binaryround(effective_cache_size * 1024 * 1024)

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [112/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)

"dw" => mem * 3 / 4,
"mixed" => mem * 3 / 4,
"desktop" => mem / 4,
}.fetch(db_type)

Choose a reason for hiding this comment

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

Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.


def downgrade(ta, td, a, d)
if ta["postgresql"]["config"].key?("max_connections")
a["postgresql"]["config"]["max_connections"] = a["postgresql"]["config_pgtune"]["max_connections"]

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [102/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)

def upgrade(ta, td, a, d)
a["postgresql"]["config_pgtune"] ||= {}
unless a["postgresql"]["config_pgtune"].key?("max_connections")
a["postgresql"]["config_pgtune"]["max_connections"] = a["postgresql"]["config"]["max_connections"]

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [102/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)

"dw" => 500,
"mixed" => 100,
"desktop" => 100,
}.fetch(db_type)

Choose a reason for hiding this comment

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

Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.

"oltp" => 100,
"dw" => 500,
"mixed" => 100,
"desktop" => 100,

Choose a reason for hiding this comment

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

Style/TrailingCommaInLiteral: Avoid comma after the last item of a hash. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)

"dw" => "0.9",
"mixed" => "0.9",
"desktop" => "0.5",
}.fetch(db_type)

Choose a reason for hiding this comment

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

Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.

"oltp" => mem / 16,
"dw" => mem / 8,
"mixed" => mem / 16,
"desktop" => mem / 16,

Choose a reason for hiding this comment

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

Style/TrailingCommaInLiteral: Avoid comma after the last item of a hash. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)

"dw" => mem_con_v / 2,
"mixed" => mem_con_v / 2,
"desktop" => mem_con_v / 6,
}.fetch(db_type)

Choose a reason for hiding this comment

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

Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.

"oltp" => mem_con_v,
"dw" => mem_con_v / 2,
"mixed" => mem_con_v / 2,
"desktop" => mem_con_v / 6,

Choose a reason for hiding this comment

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

Style/TrailingCommaInLiteral: Avoid comma after the last item of a hash. (https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas)

}.fetch(db_type)

node.default["postgresql"]["config"]["effective_cache_size"] = binaryround(effective_cache_size*1024*1024)
node.default["postgresql"]["config"]["effective_cache_size"] = binaryround(effective_cache_size * 1024 * 1024)

Choose a reason for hiding this comment

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

Metrics/LineLength: Line is too long. [112/100] (https://github.com/SUSE/style-guides/blob/master/Ruby.md#metricslinelength)

"dw" => mem * 3 / 4,
"mixed" => mem * 3 / 4,
"desktop" => mem / 4,
}.fetch(db_type)

Choose a reason for hiding this comment

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

Layout/MultilineHashBraceLayout: Closing hash brace must be on the same line as the last hash element when opening brace is on the same line as the first hash element.

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.

3 participants