getredash/redash

Can't delete a data source if one of the queries references query result from it but uses a different data source

Open

#3843 opened on May 29, 2019

View on GitHub
 (6 comments) (1 reaction) (1 assignee)Python (24,845 stars) (4,236 forks)batch import
BackendBughelp wanted

Description

Issue Summary

When you have the following situation:

Query A references query result from data source A, but itself references data source B.

You will not be able to delete data source A, because it will fail to delete the query results using it.

Steps to Reproduce

The way the above can happen is if:

  1. You execute query A while it uses data source A and update it to use data source B.
  2. If the data source update happens right after this query was executed but before we actually update the query result reference.

It's an edge case, but happened already twice for people who reported it.

The correct solution here is to update the latest_query_data_id reference to get nullified if the query result is deleted.

Technical details:

  • Redash Version: 7

Contributor guide