Uploaded image for project: 'mod-source-record-manager'
  1. mod-source-record-manager
  2. MODSOURMAN-318

Remove hardcoded diku tenant in db schema.json

    XMLWordPrintable

    Details

    • Template:
    • Sprint:
      EPAM BatchLoader Sprint 42
    • Story Points:
      0.5
    • Development Team:
      Folijet

      Description

      Noticed https://github.com/folio-org/mod-source-record-manager/blob/d115f60ee1acfa71729777e0c282b70812d70079/mod-source-record-manager-server/src/main/resources/templates/db_scripts/schema.json#L92

      It fails the folio-perf-test env build with error logs like below

      20:09:29 WARN  ProxyService         POST request for mod-source-record-manager-2.2.0-SNAPSHOT.265 /_/tenant failed with 400: [ "          CREATE OR REPLACE FUNCTION is_processing_completed(jobExecId uuid) RETURNS boolean AS $
      completed$ DECLARE completed boolean; BEGIN SELECT count(id) = (SELECT count(id) FROM job_execution_source_chunks WHERE (jsonb->>'jobExecutionId')::uuid = jobExecId) into completed FROM job_execution_source_chunks WHERE (json
      b->>'jobExecutionId')::uuid = jobExecId AND jsonb->>'state' IN ('COMPLETED', 'ERROR'); RETURN completed; END; $completed$ LANGUAGE plpgsql;\n          CREATE OR REPLACE FUNCTION processing_contains_error_chunks(jobExecId uuid
      ) RETURNS boolean AS $has_errors$ DECLARE has_errors boolean; BEGIN SELECT count(id) > 0 into has_errors FROM job_execution_source_chunks WHERE (jsonb->>'jobExecutionId')::uuid = jobExecId AND jsonb->>'state' = 'ERROR'; RETUR
      N has_errors; END; $has_errors$ LANGUAGE plpgsql;\n           CREATE TABLE IF NOT EXISTS journal_records (id UUID PRIMARY KEY, job_execution_id UUID REFERENCES job_executions(id), source_id UUID, entity_type text, entity_id t
      ext, entity_hrid text, action_type text, action_status text, action_date timestamp);           ALTER TABLE journal_records ADD COLUMN IF NOT EXISTS source_record_order integer NULL; ALTER TABLE journal_records ADD COLUMN IF N
      OT EXISTS error text NULL;           ALTER TABLE job_execution_progress DROP CONSTRAINT IF EXISTS job_execution_id_unique; ALTER TABLE job_execution_progress ADD CONSTRAINT job_execution_id_unique UNIQUE (jobExecutionId);    
             DELETE FROM diku_mod_source_record_manager.job_execution_progress jep1 USING diku_mod_source_record_manager.job_execution_progress jep2 WHERE  jep1.ctid < jep2.ctid AND jep1.jobexecutionid = jep2.jobexecutionid; GRANT 
      ALL PRIVILEGES ON ALL TABLES IN SCHEMA supertenant_mod_source_record_manager TO supertenant_mod_source_record_manager;" ]
      20:09:29 INFO  ProxyContext         621903/proxy RES 400 29701805us okapi POST request for mod-source-record-manager-2.2.0-SNAPSHOT.265 /_/tenant failed with 400: [ "          CREATE OR REPLACE FUNCTION is_processing_complete
      d(jobExecId uuid) RETURNS boolean AS $completed$ DECLARE completed boolean; BEGIN SELECT count(id) = (SELECT count(id) FROM job_execution_source_chunks WHERE (jsonb->>'jobExecutionId')::uuid = jobExecId) into completed FROM j
      ob_execution_source_chunks WHERE (jsonb->>'jobExecutionId')::uuid = jobExecId AND jsonb->>'state' IN ('COMPLETED', 'ERROR'); RETURN completed; END; $completed$ LANGUAGE plpgsql;\n          CREATE OR REPLACE FUNCTION processin
      g_contains_error_chunks(jobExecId uuid) RETURNS boolean AS $has_errors$ DECLARE has_errors boolean; BEGIN SELECT count(id) > 0 into has_errors FROM job_execution_source_chunks WHERE (jsonb->>'jobExecutionId')::uuid = jobExecI
      d AND jsonb->>'state' = 'ERROR'; RETURN has_errors; END; $has_errors$ LANGUAGE plpgsql;\n           CREATE TABLE IF NOT EXISTS journal_records (id UUID PRIMARY KEY, job_execution_id UUID REFERENCES job_executions(id), source_
      id UUID, entity_type text, entity_id text, entity_hrid text, action_type text, action_status text, action_date timestamp);           ALTER TABLE journal_records ADD COLUMN IF NOT EXISTS source_record_order integer NULL; ALTER
       TABLE journal_records ADD COLUMN IF NOT EXISTS error text NULL;           ALTER TABLE job_execution_progress DROP CONSTRAINT IF EXISTS job_execution_id_unique; ALTER TABLE job_execution_progress ADD CONSTRAINT job_execution_
      id_unique UNIQUE (jobExecutionId);           DELETE FROM diku_mod_source_record_manager.job_execution_progress jep1 USING diku_mod_source_record_manager.job_execution_progress jep2 WHERE  jep1.ctid < jep2.ctid AND jep1.jobexe
      cutionid = jep2.jobexecutionid; GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA supertenant_mod_source_record_manager TO supertenant_mod_source_record_manager;" ]
      20:09:29 ERROR HttpResponse         HTTP response code=400 msg=POST request for mod-source-record-manager-2.2.0-SNAPSHOT.265 /_/tenant failed with 400: [ "          CREATE OR REPLACE FUNCTION is_processing_completed(jobExecId
       uuid) RETURNS boolean AS $completed$ DECLARE completed boolean; BEGIN SELECT count(id) = (SELECT count(id) FROM job_execution_source_chunks WHERE (jsonb->>'jobExecutionId')::uuid = jobExecId) into completed FROM job_executio
      n_source_chunks WHERE (jsonb->>'jobExecutionId')::uuid = jobExecId AND jsonb->>'state' IN ('COMPLETED', 'ERROR'); RETURN completed; END; $completed$ LANGUAGE plpgsql;\n          CREATE OR REPLACE FUNCTION processing_contains_
      error_chunks(jobExecId uuid) RETURNS boolean AS $has_errors$ DECLARE has_errors boolean; BEGIN SELECT count(id) > 0 into has_errors FROM job_execution_source_chunks WHERE (jsonb->>'jobExecutionId')::uuid = jobExecId AND jsonb
      ->>'state' = 'ERROR'; RETURN has_errors; END; $has_errors$ LANGUAGE plpgsql;\n           CREATE TABLE IF NOT EXISTS journal_records (id UUID PRIMARY KEY, job_execution_id UUID REFERENCES job_executions(id), source_id UUID, en
      tity_type text, entity_id text, entity_hrid text, action_type text, action_status text, action_date timestamp);           ALTER TABLE journal_records ADD COLUMN IF NOT EXISTS source_record_order integer NULL; ALTER TABLE jour
      nal_records ADD COLUMN IF NOT EXISTS error text NULL;           ALTER TABLE job_execution_progress DROP CONSTRAINT IF EXISTS job_execution_id_unique; ALTER TABLE job_execution_progress ADD CONSTRAINT job_execution_id_unique U
      NIQUE (jobExecutionId);           DELETE FROM diku_mod_source_record_manager.job_execution_progress jep1 USING diku_mod_source_record_manager.job_execution_progress jep2 WHERE  jep1.ctid < jep2.ctid AND jep1.jobexecutionid = 
      jep2.jobexecutionid; GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA supertenant_mod_source_record_manager TO supertenant_mod_source_record_manager;" ]
      
      

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                ruslan_lavrov Ruslan Lavrov
                Reporter:
                hji Hongwei Ji
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:
                  Resolved:

                    TestRail: Runs

                      TestRail: Cases