Commit 2ee7cc1
committed
Summary:
Transactional DDL introduces the ability to run DDLs within a transaction block and interleaving them with DML operations. Without transactional ddl, DDLs run in their own transaction and auto-commit at the end of the statement even if they are executed in an explicit transaction block.
With txn ddl, users can also rollback the DDLs via the `ROLLBACK` or `ABORT` statement. This feature is supported by using the earlier introduced DDL atomicity feature. In DDL atomicity, we track the transaction associated with a DDL and upon txn completion, we roll-forward / rollback depending on the transaction outcome (commit or abort). Transactional DDL utilizes the atomicity infra for the rollback feature as it is just the lifetime of the transaction (txn block) which is different vs autonomous ddl transactions (statement level).
So transactional DDL depends on DDL atomicity to function correctly. If DDL atomicity is disabled, the rollback feature will not work at all and we'll lose the atomicity guarantees for DDLs.
This revision adds a validator for the flag `ysql_yb_ddl_transaction_block_enabled` which ensures that DDL atomicity is enabled when enabling transactional
DDL.
Test Plan:
- Success
```
bin/yugabyted destroy && bin/yugabyted start --ui=false --tserver_flags="ysql_yb_ddl_transaction_block_enabled=true"
bin/yugabyted destroy && bin/yugabyted start --ui=false --tserver_flags="ysql_yb_ddl_transaction_block_enabled=false,ysql_yb_ddl_rollback_enabled=false" --master_flags="ysql_yb_ddl_transaction_block_enabled=false,ysql_yb_ddl_rollback_enabled=false"
```
- Failure
```
bin/yugabyted destroy && bin/yugabyted start --ui=false --tserver_flags="ysql_yb_ddl_transaction_block_enabled=true,ysql_yb_ddl_rollback_enabled=false" --master_flags="ysql_yb_ddl_transaction_block_enabled=true,ysql_yb_ddl_rollback_enabled=false"
```
Reviewers: hsunder, patnaik.balivada, pjain, myang, bkolagani
Reviewed By: patnaik.balivada
Subscribers: ybase
Differential Revision: https://phorge.dev.yugabyte.com/D44827
1 parent 6053e29 commit 2ee7cc1
2 files changed
+7
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
| 181 | + | |
181 | 182 | | |
182 | 183 | | |
183 | 184 | | |
| |||
230 | 231 | | |
231 | 232 | | |
232 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
233 | 237 | | |
234 | 238 | | |
235 | 239 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
105 | 105 | | |
106 | 106 | | |
107 | 107 | | |
| 108 | + | |
| 109 | + | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
| |||
0 commit comments