CDLUC3 / ezid

CDLUC3 ezid
MIT License
11 stars 4 forks source link

[DATA] Queue Cleanup - Binder #726

Open adambuttrick opened 1 month ago

adambuttrick commented 1 month ago

Data Task Type

Queue Cleanup - Binder

Describe the data task needed

As described in #723, we need to clean up the ezidapp_binderqueue table, having stopped the proc-binder queue on Aug 12, 2024.

Task list

Expected outcome

Binder queue completely cleared of all records.

jsjiang commented 1 week ago

Review the binder queue ezidapp_binderqueue on EZID-PRD:

Query to get records by status:

select status, count(status) from ezidapp_binderqueue
group by status ;

Or run the management command to get records by status:

python manage.py diag-queue-stats

{
  "download": {},
  "binder": {
    "F": 6,
    "O": 4015090,
    "S": 7993776,
    "U": 669913
  },
  "datacite": {
    "F": 1565,
    "O": 5192961,
    "S": 7992232
  },
  "crossref": {
    "F": 3863,
    "I": 13155480,
    "O": 16926,
    "W": 76
  },
  "searchindexer": {
    "F": 54,
    "O": 5291658,
    "S": 9337175
  }
}
jsjiang commented 1 week ago

Backup the binder queue:

mysqldump --no-tablespaces --set-gtid-purged=OFF -h rds-uc3-ezid5-prd.cmcguhglinoa.us-west-2.rds.amazonaws.com -u eziddba -p ezid ezidapp_binderqueue > dump_binderqueue.sql

dump_binderqueue.sql file is saved on the ezid-prd instance under the /ezid/tmp/ops-scripts-data/cleanup-binder-queue folder.

jsjiang commented 1 week ago

Tested dump and restore on ezid-dev

  "binder": {
    "O": 2813,
    "S": 137359,
    "U": 16742
  },

Image Image

ezidapp_binderqueue_table_dump.sql.txt