Jira (PDB-4637) Lock out the puppetdb data user during migration

36 views
Skip to first unread message

Austin Blatt (JIRA)

unread,
Jan 27, 2020, 5:10:04 PM1/27/20
to puppe...@googlegroups.com
Austin Blatt updated an issue
 
PuppetDB / New Feature PDB-4637
Lock out the puppetdb data user during migration
Change By: Austin Blatt
Summary: Lock out the puppetdb databse data user during migration
Add Comment Add Comment
 
This message was sent by Atlassian JIRA (v7.7.1#77002-sha1:e75ca93)
Atlassian logo

Austin Blatt (JIRA)

unread,
Jan 27, 2020, 5:46:04 PM1/27/20
to puppe...@googlegroups.com
Austin Blatt updated an issue
When the puppetdb migrator is performing a migration it needs to ensure the data role is not connected to the database.

The new migration workflow should look like
* Begin a transaction,
* Lock the migration table with {{access exclusive}}
* Check to see if migrations are needed, and if so,
* Revoke connection access for data role,
* Disconnect any in-flight connections
* Perform migrations,
* Commit transaction,
* Reallow access for the data role


To disconnect the data role's database connection(s)
{code}
SELECT
pg_terminate_backend( pid )
FROM pg_stat_activity
WHERE datname='<puppetdb/pe-puppetdb>'
      AND usename='<puppetdb data role>';
{code}


For each pid returned by the above query call either
{code}
SELECT pg_cancel_backend( <pid> );
{code}
or
{code}
SELECT pg_terminate_backend( <pid> );
{code}

Austin Blatt (JIRA)

unread,
Jan 28, 2020, 1:40:04 PM1/28/20
to puppe...@googlegroups.com

Rob Browning (JIRA)

unread,
Jan 30, 2020, 5:52:04 PM1/30/20
to puppe...@googlegroups.com
Rob Browning updated an issue
Change By: Rob Browning
Acceptance Criteria: - New configuration option {{migrate}} in then the {{[database]}} section

Austin Blatt (JIRA)

unread,
Jan 30, 2020, 5:53:04 PM1/30/20
to puppe...@googlegroups.com
Austin Blatt updated an issue
Change By: Austin Blatt
When the puppetdb migrator is performing a migration it needs to ensure the data role is not connected to the database.

The new migration workflow should look like
*
Begin a transaction,
*
Lock the schema migration table with {{access exclusive}}

* Check to see if migrations are needed, and if so,
* Revoke connection access for data role,
* Disconnect any in-flight connections
* Perform migrations,
* Commit transaction,
* Reallow access for the data role


To disconnect the data role's database connection(s)
{code}
SELECT pg_terminate_backend(pid)
FROM pg_stat_activity
WHERE datname='<puppetdb/pe-puppetdb>'
      AND usename='<puppetdb data role>';
{code}

Austin Blatt (JIRA)

unread,
Jan 30, 2020, 5:55:04 PM1/30/20
to puppe...@googlegroups.com
Austin Blatt updated an issue
When the puppetdb migrator is performing a migration it needs to ensure the data role is not connected to the database.

The new migration workflow should look like
* Lock the schema migration table with {{access exclusive}}
* Check to see if migrations are needed, and if so,
* Revoke connection access for data role,
* Disconnect any in-flight connections
* Perform migrations,
* Commit transaction,
* Reallow access for the data role


To disconnect the data role's database connection(s)
{code}
SELECT pg_terminate_backend(pid)
FROM pg_stat_activity
WHERE datname='<puppetdb/pe-puppetdb>'
      AND usename ! ='<puppetdb data migrator role>';
{code}

Austin Blatt (JIRA)

unread,
Jan 30, 2020, 5:56:03 PM1/30/20
to puppe...@googlegroups.com
Austin Blatt updated an issue
Change By: Austin Blatt
Acceptance Criteria: - New configuration option {{migrate}} in the {{[database]}} section

Zachary Kent (JIRA)

unread,
Feb 26, 2020, 2:10:04 PM2/26/20
to puppe...@googlegroups.com
Zachary Kent updated an issue
Change By: Zachary Kent
Sprint: HA Team 2020-03-11

Nick Burgan (JIRA)

unread,
Feb 26, 2020, 2:28:04 PM2/26/20
to puppe...@googlegroups.com

Rob Browning (Jira)

unread,
Mar 3, 2020, 3:20:04 PM3/3/20
to puppe...@googlegroups.com
Rob Browning assigned an issue to Rob Browning
Change By: Rob Browning
Assignee: Rob Browning
This message was sent by Atlassian Jira (v8.5.2#805002-sha1:a66f935)
Atlassian logo

Nick Burgan (Jira)

unread,
Mar 11, 2020, 2:04:03 PM3/11/20
to puppe...@googlegroups.com
Nick Burgan updated an issue
Change By: Nick Burgan
Sprint: HA Team 2020-03-11 , HA Team 2020-03-25

Nick Burgan (Jira)

unread,
Mar 11, 2020, 2:11:03 PM3/11/20
to puppe...@googlegroups.com

Zachary Kent (Jira)

unread,
Mar 23, 2020, 6:11:03 PM3/23/20
to puppe...@googlegroups.com
Zachary Kent updated an issue
Change By: Zachary Kent
Fix Version/s: PDB 5.2.14
Fix Version/s: PDB 6.10.0

Nick Burgan (Jira)

unread,
Mar 25, 2020, 2:04:03 PM3/25/20
to puppe...@googlegroups.com
Nick Burgan updated an issue
Change By: Nick Burgan
Sprint: HA Team 2020-03-11, HA Team 2020-03-25 , HA Team 2020-04-08

Nick Burgan (Jira)

unread,
Apr 8, 2020, 2:24:03 PM4/8/20
to puppe...@googlegroups.com
Nick Burgan updated an issue
Change By: Nick Burgan
Sprint: HA Team 2020-03-11, HA Team 2020-03-25, HA Team 2020-04-08 , HA Team 2020-04-22 (SS 4/15)

Nick Burgan (Jira)

unread,
Apr 22, 2020, 2:14:03 PM4/22/20
to puppe...@googlegroups.com
Nick Burgan updated an issue
Change By: Nick Burgan
Sprint: HA Team 2020-03-11, HA Team 2020-03-25, HA Team 2020-04-08, HA Team 2020-04-22 (SS 4/15) , HA Team 2020-05-05

Nick Burgan (Jira)

unread,
Apr 22, 2020, 2:18:03 PM4/22/20
to puppe...@googlegroups.com

Rob Browning (Jira)

unread,
Apr 24, 2020, 12:50:03 PM4/24/20
to puppe...@googlegroups.com
Rob Browning updated an issue
Change By: Rob Browning
Release Notes Summary: PuppetDB can now be configured to attempt to prevent concurrent migrations or any access to a database that's in an unexpected format, either too new or too old.  See the [documentation](https://puppet.com/docs/puppetdb/latest/configure.html#coordinating-database-migrations) for further information. ([PDB-4636](https://tickets.puppetlabs.com/browse/PDB-4636) [PDB-4637](https://tickets.puppetlabs.com/browse/PDB-4637) [PDB-4639](https://tickets.puppetlabs.com/browse/PDB-4639))

Claudia Petty (Jira)

unread,
Jun 21, 2023, 10:57:10 AM6/21/23
to puppe...@googlegroups.com
Claudia Petty updated an issue
Change By: Claudia Petty
Labels: new-feature
This message was sent by Atlassian Jira (v8.20.21#820021-sha1:38274c8)
Atlassian logo
Reply all
Reply to author
Forward
0 new messages