citus icon indicating copy to clipboard operation
citus copied to clipboard

Adds alter database support on non-main database and on any node

Open gurkanindibay opened this issue 11 months ago • 3 comments

DESCRIPTION: Adds alter database support on non-main database and on any node

This PR introduces the ability to alter database on main and non-main databases on any node expanding the existing alter database support.

During the implementation, we encountered an issue related to the initialization of the IsMainDB parameter. As a result, we had to turn off enable_ddl_propagation in pg_regress.pl and reactivate it post-creation of the extension in the test environment.

We've added two tests to the test schedules to turn on ddl propagation:

  1. enable_ddl_propagation
  2. isolation_enable_ddl_propagation In each schedule, we've placed enable_ddl_propagation (or the other file) at the top to activate ddl propagation system-wide once. This is necessary for the propagation of helper functions.

Above tests are mostly used at the start of each schedule. Through extensive testing, we discovered that the tests minimal_cluster_management and multi_cluster_management inadvertently disable enable_ddl_propagation on worker nodes. This was causing multi_test_catalog_views to stuck. Upon further investigation, we identified that the function run_command_on_master_and_workers_temp was causing this problem. To address this, we've arranged schedule files such that enable_ddl_propagation is executed inside the minimal_cluster_management and multi_cluster_management schedules.

gurkanindibay avatar Mar 18 '24 13:03 gurkanindibay

Codecov Report

Merging #7563 (e089f90) into main (a0151aa) will decrease coverage by 0.08%. The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7563      +/-   ##
==========================================
- Coverage   89.69%   89.61%   -0.08%     
==========================================
  Files         283      283              
  Lines       60505    60541      +36     
  Branches     7538     7540       +2     
==========================================
- Hits        54270    54256      -14     
- Misses       4081     4113      +32     
- Partials     2154     2172      +18     

codecov[bot] avatar Mar 20 '24 16:03 codecov[bot]

The PR adds ability to propagate "ALTER DATABASE ..." statement from any node with the last commits. It would be good to update the PR description to reflect this.

eaydingol avatar Apr 01 '24 08:04 eaydingol

The PR adds ability to propagate "ALTER DATABASE ..." statement from any node with the last commits. It would be good to update the PR description to reflect this.

Added some more details to express the any node support

gurkanindibay avatar Apr 01 '24 08:04 gurkanindibay