JBAS-2285 authority reginest improvements
authorBill Erickson <berickxx@gmail.com>
Thu, 23 May 2019 15:16:50 +0000 (15:16 +0000)
committerBill Erickson <berickxx@gmail.com>
Thu, 23 May 2019 15:16:50 +0000 (15:16 +0000)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/sql/schema/deploy/3.2-additions.sql

index c4f8e18..7c0f697 100644 (file)
@@ -211,9 +211,12 @@ SELECT CLOCK_TIMESTAMP(), 'Done rebuilding reporter.materialized_simple_record..
 */
 
 
-BEGIN;
 SELECT CLOCK_TIMESTAMP(), 'Reingesting authority records';
 
+BEGIN;
+-- wrap the setup in a transaction so the script will die of something
+-- in here fails. Then run main reingest sans transaction.
+
 -- add the flag ingest.disable_authority_full_rec if it does not exist
 INSERT INTO config.internal_flag (name, enabled)
 SELECT 'ingest.disable_authority_full_rec', FALSE
@@ -237,6 +240,10 @@ WHERE name in (
     'ingest.disable_authority_full_rec'
 );
 
+COMMIT;
+
+-- execute the main reingest outside of a transaction
+
 ALTER TABLE authority.record_entry DISABLE TRIGGER a_marcxml_is_well_formed;
 ALTER TABLE authority.record_entry DISABLE TRIGGER b_maintain_901;
 ALTER TABLE authority.record_entry DISABLE TRIGGER c_maintain_control_numbers;
@@ -256,5 +263,4 @@ FROM internal_flag_state b
 WHERE a.name = b.name;
 
 SELECT CLOCK_TIMESTAMP(), 'Done reingesting authority records';
-COMMIT;