Skip to content

Commit c5c5826

Browse files
committed
Update database start/stop to handle multi-tier system replication
1 parent 6a7c714 commit c5c5826

2 files changed

Lines changed: 41 additions & 11 deletions

File tree

lib/wanda/operations/catalog/databasestart_v1.ex

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,37 @@ defmodule Wanda.Operations.Catalog.DatabaseStartV1 do
66
id: "databasestart@v1",
77
name: "Start HANA database",
88
description: """
9-
This operation starts a HANA database. If the database is in a system
10-
replication configuration, it only starts the site where the given target
11-
belongs to. Other sites are not impacted.
9+
This operation starts a HANA database. The database can be a standalone database
10+
or a database configured using system replication.
11+
The starting order is from system replication tier 1 to 3.
12+
If system replication is not configured it simply starts the given system.
1213
1314
Arguments:
1415
instance_number (string): Instance number to start the database
16+
system_replication_tier (number): Instance system replication tier number.
17+
Null if it does not have system replication
1518
timeout (number): Timeout in seconds to wait until the database is started
1619
""",
1720
required_args: ["instance_number"],
1821
steps: [
1922
%Wanda.Operations.Catalog.Step{
20-
name: "Start HANA database",
23+
name: "Start HANA database tier 1",
2124
operator: "sapsystemstart@v1",
22-
predicate: "*",
25+
predicate: "system_replication_tier == 1 || system_replication_tier == ()",
2326
# 12 hours
2427
timeout: 12 * 60 * 60 * 1_000
28+
},
29+
%Wanda.Operations.Catalog.Step{
30+
name: "Start HANA database tier 2",
31+
operator: "sapsystemstart@v1",
32+
predicate: "system_replication_tier == 2",
33+
timeout: 12 * 60 * 60 * 1_000
34+
},
35+
%Wanda.Operations.Catalog.Step{
36+
name: "Start HANA database tier 3",
37+
operator: "sapsystemstart@v1",
38+
predicate: "system_replication_tier == 3",
39+
timeout: 12 * 60 * 60 * 1_000
2540
}
2641
]
2742
}

lib/wanda/operations/catalog/databasestop_v1.ex

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,22 +6,37 @@ defmodule Wanda.Operations.Catalog.DatabaseStopV1 do
66
id: "databasestop@v1",
77
name: "Stop HANA database",
88
description: """
9-
This operation stops a HANA database. If the database is in a system
10-
replication configuration, it only stops the site where the given target
11-
belongs to. Other sites are not impacted.
9+
This operation stops a HANA database. The database can be a standalone database
10+
or a database configured using system replication.
11+
The stopping order is from system replication tier 3 to 1.
12+
If system replication is not configured it simply stops the given system.
1213
1314
Arguments:
1415
instance_number (string): Instance number to stop the database
16+
system_replication_tier (number): Instance system replication tier number.
17+
Null if it does not have system replication
1518
timeout (number): Timeout in seconds to wait until the database is stopped
1619
""",
17-
required_args: ["instance_number"],
20+
required_args: ["instance_number", "system_replication_tier"],
1821
steps: [
1922
%Wanda.Operations.Catalog.Step{
20-
name: "Stop HANA database",
23+
name: "Stop HANA database tier 3",
2124
operator: "sapsystemstop@v1",
22-
predicate: "*",
25+
predicate: "system_replication_tier == 3",
2326
# 12 hours
2427
timeout: 12 * 60 * 60 * 1_000
28+
},
29+
%Wanda.Operations.Catalog.Step{
30+
name: "Stop HANA database tier 2",
31+
operator: "sapsystemstop@v1",
32+
predicate: "system_replication_tier == 2",
33+
timeout: 12 * 60 * 60 * 1_000
34+
},
35+
%Wanda.Operations.Catalog.Step{
36+
name: "Stop HANA database tier 1",
37+
operator: "sapsystemstop@v1",
38+
predicate: "system_replication_tier == 1 || system_replication_tier == ()",
39+
timeout: 12 * 60 * 60 * 1_000
2540
}
2641
]
2742
}

0 commit comments

Comments
 (0)