Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"SET SEARCH_PATH" Transaction Hangs in Idle State in Postgres #42862

Open
ixipixi opened this issue May 17, 2024 · 2 comments
Open

"SET SEARCH_PATH" Transaction Hangs in Idle State in Postgres #42862

ixipixi opened this issue May 17, 2024 · 2 comments
Labels
.Backend Priority:P3 Cosmetic bugs, minor bugs with a clear workaround .Team/BackendComponents also known as BEC Type:Bug Product defects

Comments

@ixipixi
Copy link
Contributor

ixipixi commented May 17, 2024

Describe the bug

When Metabase launches a query is executed against the app db to set the "search_path" variable in Postgres. The transaction never leaves the "idle in transaction" state.

To Reproduce

  1. Start Metabase v48.5 or higher
  2. On the application database run:

SELECT pid ,datname ,usename ,application_name ,client_hostname ,client_port ,backend_start ,query_start ,query ,state
FROM pg_stat_activity
WHERE state = 'idle in transaction';

Note that the pid with the "set search_path" query in it never resolves.

Expected behavior

The transaction should complete.

Logs

No response

Information about your Metabase installation

{
  "browser-info": {
    "language": "en-US",
    "platform": "Win32",
    "userAgent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.23+9",
    "java.vendor": "Eclipse Adoptium",
    "java.vendor.url": "https://adoptium.net/",
    "java.version": "11.0.23",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.23+9",
    "os.name": "Linux",
    "os.version": "5.15.133.1-microsoft-standard-WSL2",
    "user.language": "en",
    "user.timezone": "GMT"
  },
  "metabase-info": {
    "databases": [
      "h2",
      "postgres"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "11.22 (Debian 11.22-1.pgdg110+1)"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.7.2"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2024-05-09",
      "tag": "v1.49.9",
      "hash": "c0913c7"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Severity

Unclear on if this impacts anything other than leaving a single process hanging since this is already the default setting for this value in Postgres

Additional context

No response

@ixipixi ixipixi added Type:Bug Product defects .Needs Triage Priority:P2 Average run of the mill bug labels May 17, 2024
@darksciencebase
Copy link
Contributor

@ixipixi is this a neatness issue or was there some particular fallout from this? thinking about the priority here and would like to understand the whole picture

@ixipixi
Copy link
Contributor Author

ixipixi commented May 20, 2024

@darksciencebase it's not impacting performance afaik but it creates an inconvenience for customers/sys admins/dbas that are monitoring for hanging transactions. They see a transaction stuck in idle for a long time and go research it to discover it's this every time. They know to ignore it but it's not ideal.

@darksciencebase darksciencebase added Priority:P3 Cosmetic bugs, minor bugs with a clear workaround and removed Priority:P2 Average run of the mill bug labels May 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
.Backend Priority:P3 Cosmetic bugs, minor bugs with a clear workaround .Team/BackendComponents also known as BEC Type:Bug Product defects
Projects
None yet
Development

No branches or pull requests

3 participants