Title: Postgres Online store does not always manage transactions gracefully · Issue #5038 · feast-dev/feast · GitHub
Open Graph Title: Postgres Online store does not always manage transactions gracefully · Issue #5038 · feast-dev/feast
X Title: Postgres Online store does not always manage transactions gracefully · Issue #5038 · feast-dev/feast
Description: Expected Behavior Whenever transactions are used with a Postgres online store, changes should be committed. If transactions are not required, we shouldn't open transactions (e.g. when simply reading features). Current Behavior We are usi...
Open Graph Description: Expected Behavior Whenever transactions are used with a Postgres online store, changes should be committed. If transactions are not required, we shouldn't open transactions (e.g. when simply readin...
X Description: Expected Behavior Whenever transactions are used with a Postgres online store, changes should be committed. If transactions are not required, we shouldn't open transactions (e.g. when simply re...
Opengraph URL: https://github.com/feast-dev/feast/issues/5038
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Postgres Online store does not always manage transactions gracefully","articleBody":"## Expected Behavior \n\nWhenever transactions are used with a Postgres online store, changes should be committed. If transactions are not required, we shouldn't open transactions (e.g. when simply reading features).\n\n## Current Behavior\n\nWe are using `psycopg3` in case we use Postgres for the online store. If you create connections with `psycopg3` using a context manager (i.e. a `with ...` block), it will automatically commit the transaction once you exit the context. However, in `feast` we are manually creating (and in the case of connection pools, putting) connections, so we need to ensure that we also explicitly call `commit` after firing queries to the database. \n\nThe `commit` statements were missing for (async) read methods of the `PostgresOnlineStore` and the `teardown` method. For the read statements, this wasn't an issue as we just do a `SELECT`. However, it does add warning statements and quite a bit of latency as transactions needed to be rolled back. \n\nThe warning statement: \n```\n2025-02-07 14:05:40,301 WARNING [psycopg.pool] rolling back returned connection: \u003cpsycopg.AsyncConnection [INTRANS] (host=\u003cREDACTED\u003e port=\u003cREDACTED\u003e user=\u003cREDACTED\u003e database=\u003cREDACTED\u003e) at 0x314498790\u003e\n\n```\n\n### Specifications\n\n- Version: 0.40.1\n- Platform: MacOS\n- Subsystem: Sequoia 15.2\n\n## Possible Solution\n\nAdd missing `commit` calls and enable `autocommit` if a transaction is not needed for improved performance (e.g. for read methods).\n\nFiled a PR here: https://github.com/feast-dev/feast/pull/5039","author":{"url":"https://github.com/TomSteenbergen","@type":"Person","name":"TomSteenbergen"},"datePublished":"2025-02-10T13:57:00.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/5038/feast/issues/5038"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:ffe8a3ba-e92c-581c-72e9-e56c2dd285f4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EA04:2B3321:37DC3D:4D5E52:6978B468 |
| html-safe-nonce | adca38913fe8f4d916c00ee882fe8d4e36288c902dac29036f699beb4e733e7a |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQTA0OjJCMzMyMTozN0RDM0Q6NEQ1RTUyOjY5NzhCNDY4IiwidmlzaXRvcl9pZCI6IjE2NDgwNzg5NjE1NTgyMDU1NDQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 6da5b1a83a9d77a76ba704d57981d10ca20deae7623194a59e051ef1bcf9bacc |
| hovercard-subject-tag | issue:2842493926 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/feast-dev/feast/5038/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0cf51cb27d67b4ff33a109ff0acca845cf11bb67596c36d1ff5d043749b6cfd2/feast-dev/feast/issues/5038 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0cf51cb27d67b4ff33a109ff0acca845cf11bb67596c36d1ff5d043749b6cfd2/feast-dev/feast/issues/5038 |
| og:image:alt | Expected Behavior Whenever transactions are used with a Postgres online store, changes should be committed. If transactions are not required, we shouldn't open transactions (e.g. when simply readin... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | TomSteenbergen |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2981c597c945c1d90ac6fa355ce7929b2f413dfe7872ca5c435ee53a24a1de50 |
| turbo-cache-control | no-preview |
| go-import | github.com/feast-dev/feast git https://github.com/feast-dev/feast.git |
| octolytics-dimension-user_id | 57027613 |
| octolytics-dimension-user_login | feast-dev |
| octolytics-dimension-repository_id | 161133770 |
| octolytics-dimension-repository_nwo | feast-dev/feast |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 161133770 |
| octolytics-dimension-repository_network_root_nwo | feast-dev/feast |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | f8aa86d87c47054170094daaf9699b27a28a8448 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width