Skip to content

Commit

Permalink
Add max_migration_statement_runtime_in_seconds config property
Browse files Browse the repository at this point in the history
This change enables operators to configure
the new config property `max_migration_statement_runtime_in_seconds`
see cloudfoundry/cloud_controller_ng#3633.
  • Loading branch information
FloThinksPi committed Feb 21, 2024
1 parent 93bd263 commit 3f45cd7
Show file tree
Hide file tree
Showing 8 changed files with 17 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jobs/cc_deployment_updater/spec
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ properties:
description: "the maximum time migrations should be allowed to run before job startup should error"
default: 20160

ccdb.max_migration_statement_runtime_in_seconds:
description: "effective for postgres only. The maximum time a statement is executed before it being canceled server side(by the DB). This prevents expensive and long running migrations that block normal operation of the Cloud Controller by canceling misbehaving migrations. An operator can decide to increase or decrease this time."
default: 30

cc.database_encryption.keys:
default: {}
description: "label-key pairs for encrypting sensitive values in the CC database; labels must be < 256 characters long"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ external_domain: <%= link("cloud_controller_internal").p("cc.external_host") %>.
end
%>
max_migration_duration_in_minutes: <%= p("ccdb.max_migration_duration_in_minutes") %>
max_migration_statement_runtime_in_seconds: <%= p("ccdb.max_migration_statement_runtime_in_seconds") %>
db: &db
database:
adapter: <%= p("ccdb.db_scheme") == "mysql" ? "mysql2" : p("ccdb.db_scheme") %>
Expand Down
3 changes: 3 additions & 0 deletions jobs/cloud_controller_clock/spec
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ properties:
ccdb.max_migration_duration_in_minutes:
description: "the maximum time migrations should be allowed to run before job startup should error"
default: 20160
ccdb.max_migration_statement_runtime_in_seconds:
description: "effective for postgres only. The maximum time a statement is executed before it being canceled server side(by the DB). This prevents expensive and long running migrations that block normal operation of the Cloud Controller by canceling misbehaving migrations. An operator can decide to increase or decrease this time."
default: 30
cc.allow_app_ssh_access:
default: true
description: "Allow users to change the value of the app-level allow_ssh attribute"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ loggregator:
end
%>
max_migration_duration_in_minutes: <%= p("ccdb.max_migration_duration_in_minutes") %>
max_migration_statement_runtime_in_seconds: <%= p("ccdb.max_migration_statement_runtime_in_seconds") %>
db: &db
database:
adapter: <%= p("ccdb.db_scheme") == "mysql" ? "mysql2" : p("ccdb.db_scheme") %>
Expand Down
3 changes: 3 additions & 0 deletions jobs/cloud_controller_ng/spec
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,9 @@ properties:
ccdb.max_migration_duration_in_minutes:
description: "the maximum time migrations should be allowed to run before job startup should error"
default: 20160
ccdb.max_migration_statement_runtime_in_seconds:
description: "effective for postgres only. The maximum time a statement is executed before it being canceled server side(by the DB). This prevents expensive and long running migrations that block normal operation of the Cloud Controller by canceling misbehaving migrations. An operator can decide to increase or decrease this time."
default: 30
ccdb.connection_expiration_timeout:
description: "The period in seconds after which connections are expired (omit to never expire connections), passed directly to the Sequel gem - see https://sequel.jeremyevans.net/rdoc-plugins/files/lib/sequel/extensions/connection_expiration_rb.html for details"
ccdb.connection_expiration_random_delay:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ db: &db
<% uaa_url = p("uaa.url", "#{scheme}://uaa.#{system_domain}")
login_url = p("login.url", "#{scheme}://login.#{system_domain}") %>
max_migration_duration_in_minutes: <%= p("ccdb.max_migration_duration_in_minutes") %>
max_migration_statement_runtime_in_seconds: <%= p("ccdb.max_migration_statement_runtime_in_seconds") %>
login:
url: <%= p("login.enabled") ? login_url : uaa_url %>
uaa:
Expand Down
3 changes: 3 additions & 0 deletions jobs/cloud_controller_worker/spec
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,9 @@ properties:
ccdb.max_migration_duration_in_minutes:
description: "the maximum time migrations should be allowed to run before job startup should error"
default: 20160
ccdb.max_migration_statement_runtime_in_seconds:
description: "effective for postgres only. The maximum time a statement is executed before it being canceled server side(by the DB). This prevents expensive and long running migrations that block normal operation of the Cloud Controller by canceling misbehaving migrations. An operator can decide to increase or decrease this time."
default: 30
cc.db_encryption_key:
default: ""
description: "key for encrypting sensitive values in the CC database"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ loggregator:
end
%>
max_migration_duration_in_minutes: <%= p("ccdb.max_migration_duration_in_minutes") %>
max_migration_statement_runtime_in_seconds: <%= p("ccdb.max_migration_statement_runtime_in_seconds") %>
db: &db
database:
adapter: <%= p("ccdb.db_scheme") == "mysql" ? "mysql2" : p("ccdb.db_scheme") %>
Expand Down

0 comments on commit 3f45cd7

Please sign in to comment.