Bug 1980678 - [RFE]: Replace DELETE with TRUNCATE were possible
Summary: [RFE]: Replace DELETE with TRUNCATE were possible
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 3.1
Hardware: x86_64
OS: Linux
unspecified
low
Target Milestone: ---
: 4.0
Assignee: candlepin-bugs
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 1980023
TreeView+ depends on / blocked
 
Reported: 2021-07-09 08:53 UTC by Nikos Moumoulidis
Modified: 2021-09-02 09:04 UTC (History)
5 users (show)

Fixed In Version: candlepin-4.0.7-1
Clone Of: 1980023
Environment:
Last Closed: 2021-09-02 09:04:58 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github candlepin candlepin pull 3100 0 None None None 2021-08-09 15:18:30 UTC

Description Nikos Moumoulidis 2021-07-09 08:53:07 UTC
+++ This bug was initially created as a clone of Bug #1980023 +++

Description of problem:
The satellite-installer timeout value by default isn't very long by default. Waiting for DELETE requests on postgres have exceeded the timeout of the installer causing the installer to fail and have to be run again. Could instances of DELETE be changed for TRUNCATE where possible for DB updates/migrations/changes?

Version-Release number of selected component (if applicable):
candlepin-3.1.28-1

How reproducible:
n/a

Steps to Reproduce:
1.
2.
3.

Actual results:
/var/log/foreman-installer/satellite.log:
[DEBUG 2021-07-04T19:28:32 main]  Exec[cpdb update](provider=posix): Executing 'cpdb --update --dbhost=192.168.2.5 --dbport=5432 --database='candlepin' --user='candlepin' --password='candlepin' >> /var/log/candlepin/cpdb.log 2>&1 && touch /var/lib/candlepin/cpdb_update_done'
[ERROR 2021-07-04T19:33:32 main]  Command exceeded timeout
[ERROR 2021-07-04T19:33:32 main]  /Stage[main]/Candlepin::Database::Postgresql/Exec[cpdb update]/returns: change from 'notrun' to ['0'] failed: Command exceeded timeout
[ INFO 2021-07-04T19:33:32 main]  /Stage[main]/Candlepin::Database::Postgresql/Exec[cpdb update]: Evaluated in 300.01 seconds


postgres-<DAY>.log:
postgresql-Sun.log:2021-07-04 20:24:46 CEST STATEMENT:  DELETE FROM public.cp_cont_access_cert
postgresql-Sun.log:2021-07-04 22:45:06 CEST LOG:  duration: 8242870.193 ms  execute <unnamed>: DELETE FROM public.cp_cont_access_cert


Additional tries to run the installer while this DELETE was left running after the installer timed out resulted in the following errors in the cpdb.log:
########## ERROR ############
Error running command: /usr/share/candlepin/liquibase.sh --driver=org.postgresql.Driver --classpath=/var/lib/tomcat/webapps/candlepin/WEB-INF/lib/postgresql-42.2.2.jar:/var
/lib/tomcat/webapps/candlepin/WEB-INF/classes/ --changeLogFile=db/changelog/changelog-update.xml --url="jdbc:postgresql://192.168.2.5:5432/candlepin" --username=$DBUSERNAM
E --password=$DBPASSWORD --logLevel=severe migrate -Dcommunity=False
Status code: 65280
Command output: SEVERE 7/4/21 7:26 PM:liquibase: db/changelog/20201103112757-purge-current-sca-certs.xml::20201103112757-1::crog: Could not release lock
liquibase.exception.LockException: liquibase.exception.UnexpectedLiquibaseException: liquibase.exception.DatabaseException: org.postgresql.util.PSQLException: This connecti
on has been closed.
        at liquibase.lockservice.StandardLockService.releaseLock(StandardLockService.java:234)
--snip--
        ... 27 more
Liquibase update Failed: Migration failed for change set db/changelog/20201103112757-purge-current-sca-certs.xml::20201103112757-1::crog:
     Reason: liquibase.exception.UnexpectedLiquibaseException: org.postgresql.util.PSQLException: This connection has been closed.

Expected results:
A TRUNCATE action for this table would have completed faster and allowed the installer to keep moving along. I assume this is known and a DELETE was explicitly used here as it was necessary for a particular reason. Filing an RFE just to be sure.

Additional info:


Note You need to log in before you can comment on or make changes to this bug.