Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-32290

A create-table failure led to registry corruption

    XMLWordPrintable

    Details

    • Story Points:
      1
    • Sprint:
      DB_F21_06
    • Team:
      Data Access and Database
    • Urgent?:
      No

      Description

      In PREOPS-707 step5c (consolidateAssocDiaSourceTable,consolidateFullDiaObjectTable) on late Oct 15, the merge job failed due to a database permission issue:

        File "/opt/lsst/software/stack/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-0.7.0/lib/python3.8/site-packages/sqlalchemy/engine/default.py", line 717, in do_execute
          cursor.execute(statement, parameters)
      sqlalchemy.exc.ProgrammingError: (psycopg2.errors.InsufficientPrivilege) permission denied for table dataset_type[SQL: 
      CREATE TABLE dc2_20210215.dataset_tags_00000019 (
      	dataset_type_id BIGINT NOT NULL, 
      	dataset_id UUID, 
      	collection_name TEXT, 
      	instrument VARCHAR(16) NOT NULL, 
      	skymap TEXT NOT NULL, 
      	tract BIGINT NOT NULL, 
      	PRIMARY KEY (dataset_id, collection_name), 
      	CONSTRAINT dataset_tags_00000019_unq_dataset_type_id_collection_n_354a0432 UNIQUE (dataset_type_id, collection_name, instrument, skymap, tract), 
      	CONSTRAINT fkey_dataset_tags_00000019_dataset_type_id_dataset_type_id FOREIGN KEY(dataset_type_id) REFERENCES dc2_20210215.dataset_type (id), 
      	CONSTRAINT fkey_dataset_tags_00000019_dataset_id_dataset_id FOREIGN KEY(dataset_id) REFERENCES dc2_20210215.dataset (id) ON DELETE CASCADE, 
      	CONSTRAINT fkey_dataset_tags_00000019_collection_name_collection_name FOREIGN KEY(collection_name) REFERENCES dc2_20210215.collection (name) ON DELETE CASCADE, 
      	CONSTRAINT fkey_dataset_tags_00000019_collection_summary_dataset__427ded57 FOREIGN KEY(collection_name, dataset_type_id) REFERENCES dc2_20210215.collection_summary_dataset_type (collection_name, dataset_type_id), 
      	CONSTRAINT fkey_dataset_tags_00000019_instrument_name_instrument FOREIGN KEY(instrument) REFERENCES dc2_20210215.instrument (name), 
      	CONSTRAINT fkey_dataset_tags_00000019_collection_summary_instrume_58e025bf FOREIGN KEY(collection_name, instrument) REFERENCES dc2_20210215.collection_summary_instrument (collection_name, instrument), 
      	CONSTRAINT fkey_dataset_tags_00000019_skymap_name_skymap FOREIGN KEY(skymap) REFERENCES dc2_20210215.skymap (name), 
      	CONSTRAINT fkey_dataset_tags_00000019_collection_summary_skymap_c_369c5dbb FOREIGN KEY(collection_name, skymap) REFERENCES dc2_20210215.collection_summary_skymap (collection_name, skymap), 
      	CONSTRAINT fkey_dataset_tags_00000019_tract_skymap_id_skymap_tract FOREIGN KEY(skymap, tract) REFERENCES dc2_20210215.tract (skymap, id)
      )
      

      This failure led to many mysterious issues with this butler repo on IDF, including
      (1) Re-running the merge job (final_job.bash) failed differently:

      File "/opt/lsst/software/stack_w_2021_40/conda/miniconda3-py38_4.9.2/envs/lsst-scipipe-0.7.0/lib/python3.8/site-packages/sqlalchemy/util/compat.py", line 207, in raise_
         raise exception
      sqlalchemy.exc.ArgumentError: subject table for an INSERT, UPDATE or DELETE expected, got None.
      

      (2) Running the consolidateAssocDiaSourceTable task directly

      File "/opt/lsst/software/stack/stack/miniconda3-py38_4.9.2-0.7.0/Linux64/daf_butler/22.0.1-79-g8f638725+d18c45d440/python/lsst/daf/butler/registry/interfaces/_database.py", line 1381, in insert
          connection.execute(table.insert(), rows)
      AttributeError: 'NoneType' object has no attribute 'insert'
      

      but running other tasks was okay.

      (3) butler-query-datasets weirdness: DM-32286

        Attachments

          Issue Links

            Activity

            Hide
            jbosch Jim Bosch added a comment -

            Looks good!

            Show
            jbosch Jim Bosch added a comment - Looks good!
            Hide
            yusra Yusra AlSayyad added a comment -

            Hi Andy Salnikov, Tim requested that this be backported to v23. We have some instructions for how to backport this to v23.0.x here: https://developer.lsst.io/v/DM-32357/work/backports.html

            You have a couple options:
            1) Follow the instructions to backport it yourself (and ask for clarification if they're confusing, I'll incorporate your suggestions into the guide) or
            2) Ask one of the DP0.2 release managers (which is me right now) to backport it.

            We are planning on building v23.0.0.rc3 on Thursday Nov 11.

            Show
            yusra Yusra AlSayyad added a comment - Hi Andy Salnikov , Tim requested that this be backported to v23. We have some instructions for how to backport this to v23.0.x here: https://developer.lsst.io/v/DM-32357/work/backports.html You have a couple options: 1) Follow the instructions to backport it yourself (and ask for clarification if they're confusing, I'll incorporate your suggestions into the guide) or 2) Ask one of the DP0.2 release managers (which is me right now) to backport it. We are planning on building v23.0.0.rc3 on Thursday Nov 11.
            Hide
            salnikov Andy Salnikov added a comment -

            Yusra AlSayyad, I should have time to work on backport later today.

            Show
            salnikov Andy Salnikov added a comment - Yusra AlSayyad , I should have time to work on backport later today.
            Hide
            salnikov Andy Salnikov added a comment -

            Yusra AlSayyad, I have self-reviewed the pull request (https://github.com/lsst/daf_butler/pull/592) as the patch is small and there were no conflicts during rebase. Merged and labeled this ticket backport-done.

            Show
            salnikov Andy Salnikov added a comment - Yusra AlSayyad , I have self-reviewed the pull request ( https://github.com/lsst/daf_butler/pull/592 ) as the patch is small and there were no conflicts during rebase. Merged and labeled this ticket backport-done .
            Hide
            salnikov Andy Salnikov added a comment -

            Forgot to mention - Jenkins ran fine on centos7, macos failed in ip_diffim tests, I saw that with other branches, I don't think it's related to this change.

            Show
            salnikov Andy Salnikov added a comment - Forgot to mention - Jenkins ran fine on centos7, macos failed in ip_diffim tests, I saw that with other branches, I don't think it's related to this change.

              People

              Assignee:
              salnikov Andy Salnikov
              Reporter:
              hchiang2 Hsin-Fang Chiang
              Reviewers:
              Jim Bosch
              Watchers:
              Andy Salnikov, Hsin-Fang Chiang, Huan Lin, Jim Bosch, Tim Jenness, Yusra AlSayyad
              Votes:
              0 Vote for this issue
              Watchers:
              6 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.