Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xavier Thompson
slapos
Commits
bcc09491
Commit
bcc09491
authored
Feb 12, 2025
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
stack/erp5: Reorganize mariadb replication jinja
parent
b4a1cf36
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
14 deletions
+15
-14
stack/erp5/buildout.hash.cfg
stack/erp5/buildout.hash.cfg
+1
-1
stack/erp5/instance-mariadb.cfg.in
stack/erp5/instance-mariadb.cfg.in
+14
-13
No files found.
stack/erp5/buildout.hash.cfg
View file @
bcc09491
...
...
@@ -26,7 +26,7 @@ md5sum = d10b8e35b02b5391cf46bf0c7dbb1196
[template-mariadb]
filename = instance-mariadb.cfg.in
md5sum =
e7a5e3863a673cb229855e1fbdbe0ba6
md5sum =
32a9e848d8e90a6f5f43dd6474706d07
[template-kumofs]
filename = instance-kumofs.cfg.in
...
...
stack/erp5/instance-mariadb.cfg.in
View file @
bcc09491
...
...
@@ -20,7 +20,20 @@
{% endif -%}
{% set bash = parameter_dict['bash'] ~ '/bin/bash' -%}
{% set dash = parameter_dict['dash-location'] ~ '/bin/dash' -%}
{#- Replication parameters -#}
{% set replication = slapparameter_dict.get('replication', {}) -%}
{% if replication -%}
{# cast to assert types -#}
{% set replica_threshold = int(replication.get('seconds-behind-master-threshold', -1)) -%}
{% set primary_url = str(replication['primary-url']) -%}
{% set bootstrap_url = replication.get('bootstrap-url') -%}
{% set primary = urllib_parse.urlsplit(primary_url) -%}
{% else -%}
{% set primary_url = None -%}
{% set primary = {'hostname': None, 'port': None, 'username': None} -%}
{% set replica_threshold = None -%}
{% endif -%}
[{{ section('publish') }}]
...
...
@@ -219,9 +232,6 @@ context =
{%- endif %}
{% if replication -%}
{% set bootstrap_url = replication.get('bootstrap-url') -%}
{% set primary_url = replication['primary-url'] -%}
{% set primary = urllib_parse.urlsplit(primary_url) -%}
[{{ section('mariadb-setup-replication') }}]
recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
...
...
@@ -316,15 +326,6 @@ inline =
echo "Starting mariadb normally"
{%- endif %}
{% if replication -%}
{# cast to assert types -#}
{% set threshold = int(replication.get('seconds-behind-master-threshold', -1)) -%}
{% set primary_url = str(primary_url) -%}
{% else -%}
{% set primary_url = None -%}
{% set primary = {'hostname': None, 'port': None, 'username': None} -%}
{% set threshold = None -%}
{% endif -%}
[mariadb-replication-sense]
recipe = slapos.recipe.template
output = ${directory:bin}/${:_buildout_section_name_}
...
...
@@ -339,7 +340,7 @@ inline =
expected_url = {{ repr(primary_url) }}
expected = {{ repr((primary.hostname, primary.port, primary.username)) }}
max_delay = {{ threshold }}
max_delay = {{
replica_
threshold }}
@implementer(interface.IPromise)
class RunPromise(GenericPromise):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment