You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The main purpose of the management command scrub_user_tables is to check whether there are any user in the database where the corresponding query job is not in the phase COMPLETED or EXECUTING. The found tables can be deleted if the flag --delete is used.
The issue occurs if the table name is used several times after archiving previous tables. In this case, there are several jobs using the same table name where only one of the jobs has the valid phase. It's not guaranteed that during the filtering we get the job with the correct phase.
Proposed solution
I think that ordering of the result by creation date before executing first() might solve the issue. Only the most current queryjob using the table name must be valid.
The text was updated successfully, but these errors were encountered:
The main purpose of the management command
scrub_user_tables
is to check whether there are any user in the database where the corresponding query job is not in the phaseCOMPLETED
orEXECUTING
. The found tables can be deleted if the flag--delete
is used.The selection of tables happens here
daiquiri/daiquiri/query/management/commands/scrub_user_tables.py
Lines 33 to 40 in f980bc9
The issue occurs if the table name is used several times after archiving previous tables. In this case, there are several jobs using the same table name where only one of the jobs has the valid phase. It's not guaranteed that during the filtering we get the job with the correct phase.
Proposed solution
I think that ordering of the result by creation date before executing
first()
might solve the issue. Only the most current queryjob using the table name must be valid.The text was updated successfully, but these errors were encountered: