Skip to content

Commit 2cb0091

Browse files
committed
feat: add failure strategies
Signed-off-by: Animesh Pathak <[email protected]>
1 parent a8d0c7e commit 2cb0091

File tree

3 files changed

+76
-0
lines changed

3 files changed

+76
-0
lines changed
Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
---
2+
title: Failure Strategies in Database DevOps
3+
sidebar_label: DB DevOps Failure Strategies
4+
description: Learn about supported failure strategies in Harness Database DevOps, including rollback options such as Mark Changeset Ran and Ignore.
5+
sidebar_position: 6
6+
keywords:
7+
- database failure strategies
8+
- db rollback
9+
- harness database devops
10+
- failure handling
11+
- changeset rollback
12+
- dbops pipeline
13+
- database automation
14+
- database deployment failure
15+
- database ci cd
16+
- liquibase rollback
17+
tags:
18+
- harness-db-devops
19+
- dbops
20+
- rollback
21+
- failure-strategies
22+
---
23+
24+
In Database DevOps pipelines, failures may occur during execution due to invalid changes, dependency conflicts, or runtime issues. Harness provides rollback-focused failure strategies to help you manage such cases.
25+
26+
:::info
27+
This document focuses on failure strategies specific to Database DevOps steps. For general failure handling in Harness pipelines, see [Failure Strategies](https://developer.harness.io/docs/platform/pipelines/failure-handling/define-a-failure-strategy-on-stages-and-steps/).
28+
:::
29+
30+
## Supported Failure Strategies
31+
32+
### Mark Failed Changeset Ran
33+
The **Mark Failed Changeset Ran** option is available in the **Apply Schema** step under Harness Database DevOps.
34+
35+
When enabled, it ensures that failed changesets are marked as **ran** in the database changelog table, even if they don’t execute successfully.
36+
37+
- **When to use:**
38+
Use this option when you want rollback steps to include failed changesets, so that rollback scripts can attempt to clean up any partial changes. This is particularly useful for databases that implicitly commit DML statements (such as Oracle), where rollback logic must handle partial failures.
39+
40+
- **Outcome:**
41+
- The failed changeset is flagged as **ran**, so it won’t be retried in future runs.
42+
- If a rollback step exists (and rollback scripts are defined), it will execute rollback logic for the failed changeset.
43+
44+
![Apply Schema with Mark Failed Changeset Ran enabled](./static/mark-failed-changeset-ran.png)
45+
46+
:::info
47+
For more details, see [Mark Failed Changeset Ran](../features/mark-failed-changeset-ran.md).
48+
:::
49+
50+
### Ignore
51+
Skips the rollback attempt for the failed changeset.
52+
53+
- **When to use:**
54+
If the rollback expression may not be valid due to an earlier failure (for example, if a tag before the update did not execute successfully).
55+
56+
- **Outcome:**
57+
The failed changeset remains as-is, and the pipeline continues execution without reverting it.
58+
59+
![Ignore Failure Step](./static/image.png)
60+
61+
:::caution
62+
Use this strategy carefully. Ignoring a failed rollback can leave your database in a partially applied state.
63+
:::
64+
65+
## Unsupported Failure Strategies
66+
The following strategies are **not supported** in Database DevOps steps:
67+
- Retry
68+
- Mark as Success
69+
- Stage-level failure handling
70+
71+
If these are configured at higher levels, Harness ignores them during Database DevOps step execution.
72+
73+
## Best Practices
74+
- Always test rollback scripts alongside forward changes to ensure safe recovery paths.
75+
- Use `Ignore` only when rollback logic is invalid or unnecessary.
76+
- Prefer `Mark Failed Changeset Ran` when you want to unblock pipeline execution but avoid reapplying the same changeset.
352 KB
Loading
131 KB
Loading

0 commit comments

Comments
 (0)