Title: Transaction aborted while reading table · Issue #301 · googleapis/python-spanner-sqlalchemy · GitHub
Open Graph Title: Transaction aborted while reading table · Issue #301 · googleapis/python-spanner-sqlalchemy
X Title: Transaction aborted while reading table · Issue #301 · googleapis/python-spanner-sqlalchemy
Description: Hello, I am trying to read data from a spanner table that currently has 134.964 rows and 288 columns. I have been using the example posted in the Github under "Read" and modying the query to read less rows between each cycle. The first i...
Open Graph Description: Hello, I am trying to read data from a spanner table that currently has 134.964 rows and 288 columns. I have been using the example posted in the Github under "Read" and modying the query to read l...
X Description: Hello, I am trying to read data from a spanner table that currently has 134.964 rows and 288 columns. I have been using the example posted in the Github under "Read" and modying the query...
Opengraph URL: https://github.com/googleapis/python-spanner-sqlalchemy/issues/301
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Transaction aborted while reading table","articleBody":"\r\nHello,\r\n\r\n\r\nI am trying to read data from a spanner table that currently has 134.964 rows and 288 columns.\r\n\r\nI have been using the example posted in the Github under \"Read\" and modying the query to read less rows between each cycle.\r\n\r\nThe first issue is that it takes a good couple minutes (Probably 3+ to execute said transactions) and the second is that they keep failing.\r\n\r\nHere is the error:\r\n\r\n```\r\nTraceback (most recent call last):\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\api_core\\grpc_helpers.py\", line 72, in error_remapped_callable\r\n return callable_(*args, **kwargs)\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\grpc\\_channel.py\", line 946, in __call__\r\n return _end_unary_response_blocking(state, call, False, None)\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\grpc\\_channel.py\", line 849, in _end_unary_response_blocking\r\n raise _InactiveRpcError(state)\r\ngrpc._channel._InactiveRpcError: \u003c_InactiveRpcError of RPC that terminated with:\r\n\tstatus = StatusCode.ABORTED\r\n\tdetails = \"Transaction was aborted.\"\r\n\tdebug_error_string = \"{\"created\":\"@1673589122.237000000\",\"description\":\"Error received from peer ipv4:142.250.219.234:443\",\"file\":\"src/core/lib/surface/call.cc\",\"file_line\":904,\"grpc_message\":\"Transaction was aborted.\",\"grpc_status\":10}\"\r\n\u003e\r\nThe above exception was the direct cause of the following exception:\r\nTraceback (most recent call last):\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\cloud\\spanner_dbapi\\connection.py\", line 391, in commit\r\n self._transaction.commit()\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\cloud\\spanner_v1\\transaction.py\", line 199, in commit\r\n response = api.commit(\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\cloud\\spanner_v1\\services\\spanner\\client.py\", line 1789, in commit\r\n response = rpc(\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\api_core\\gapic_v1\\method.py\", line 113, in __call__\r\n return wrapped_func(*args, **kwargs)\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\api_core\\retry.py\", line 349, in retry_wrapped_func\r\n return retry_target(\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\api_core\\retry.py\", line 191, in retry_target\r\n return target()\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\api_core\\grpc_helpers.py\", line 74, in error_remapped_callable\r\n raise exceptions.from_grpc_error(exc) from exc\r\ngoogle.api_core.exceptions.Aborted: 409 Transaction was aborted. [retry_delay {\r\n nanos: 10853187\r\n}\r\n]\r\nDuring handling of the above exception, another exception occurred:\r\nTraceback (most recent call last):\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 1089, in _commit_impl\r\n self.engine.dialect.do_commit(self.connection)\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\cloud\\sqlalchemy_spanner\\sqlalchemy_spanner.py\", line 990, in do_commit\r\n dbapi_connection.commit()\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\cloud\\spanner_dbapi\\connection.py\", line 396, in commit\r\n self.retry_transaction()\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\cloud\\spanner_dbapi\\connection.py\", line 277, in retry_transaction\r\n self._rerun_previous_statements()\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\cloud\\spanner_dbapi\\connection.py\", line 324, in _rerun_previous_statements\r\n _compare_checksums(statement.checksum, retried_checksum)\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\cloud\\spanner_dbapi\\checksum.py\", line 78, in _compare_checksums\r\n raise RetryAborted(\r\ngoogle.cloud.spanner_dbapi.exceptions.RetryAborted: The transaction was aborted and could not be retried due to a concurrent modification.\r\nThe above exception was the direct cause of the following exception:\r\nTraceback (most recent call last):\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\IPython\\core\\interactiveshell.py\", line 3251, in run_code\r\n exec(code_obj, self.user_global_ns, self.user_ns)\r\n File \"\u003cipython-input-220-dacab1707a8a\u003e\", line 3, in \u003cmodule\u003e\r\n loaded_data = connection2.execute(table.select().limit(100000).offset(data_offset)).fetchall()\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 3100, in __exit__\r\n self.transaction.__exit__(type_, value, traceback)\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\sqlalchemy\\engine\\util.py\", line 237, in __exit__\r\n self.rollback()\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\sqlalchemy\\util\\langhelpers.py\", line 70, in __exit__\r\n compat.raise_(\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\sqlalchemy\\util\\compat.py\", line 211, in raise_\r\n raise exception\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\sqlalchemy\\engine\\util.py\", line 233, in __exit__\r\n self.commit()\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 2459, in commit\r\n self._do_commit()\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 2649, in _do_commit\r\n self._connection_commit_impl()\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 2620, in _connection_commit_impl\r\n self.connection._commit_impl()\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 1091, in _commit_impl\r\n self._handle_dbapi_exception(e, None, None, None, None)\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 2124, in _handle_dbapi_exception\r\n util.raise_(\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\sqlalchemy\\util\\compat.py\", line 211, in raise_\r\n raise exception\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\sqlalchemy\\engine\\base.py\", line 1089, in _commit_impl\r\n self.engine.dialect.do_commit(self.connection)\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\cloud\\sqlalchemy_spanner\\sqlalchemy_spanner.py\", line 990, in do_commit\r\n dbapi_connection.commit()\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\cloud\\spanner_dbapi\\connection.py\", line 396, in commit\r\n self.retry_transaction()\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\cloud\\spanner_dbapi\\connection.py\", line 277, in retry_transaction\r\n self._rerun_previous_statements()\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\cloud\\spanner_dbapi\\connection.py\", line 324, in _rerun_previous_statements\r\n _compare_checksums(statement.checksum, retried_checksum)\r\n File \"D:\\bupryhr_dev\\venv\\lib\\site-packages\\google\\cloud\\spanner_dbapi\\checksum.py\", line 78, in _compare_checksums\r\n raise RetryAborted(\r\nsqlalchemy.exc.OperationalError: (google.cloud.spanner_dbapi.exceptions.RetryAborted) The transaction was aborted and could not be retried due to a concurrent modification.\r\n(Background on this error at: https://sqlalche.me/e/14/e3q8)\r\n```","author":{"url":"https://github.com/Joselguti","@type":"Person","name":"Joselguti"},"datePublished":"2023-01-13T06:02:41.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":4},"url":"https://github.com/301/python-spanner-sqlalchemy/issues/301"}
| 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:f0733ede-749f-1c01-c718-b897d28253e7 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | BAB2:2D7E24:FB1EF:16467C:6978801F |
| html-safe-nonce | 2399a85e325848630fde090ddf5446fc9b6fb85b008f8176bd783ad3da556506 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCQUIyOjJEN0UyNDpGQjFFRjoxNjQ2N0M6Njk3ODgwMUYiLCJ2aXNpdG9yX2lkIjoiNzQ3MjU2NDQxODk2MjI5Mjc2NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | f1564fecf8aace2927fc2730192b22f4073a113d789fcfb201990c37937bb6a4 |
| hovercard-subject-tag | issue:1531752676 |
| 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/googleapis/python-spanner-sqlalchemy/301/issue_layout |
| twitter:image | https://opengraph.githubassets.com/063c25f5833af970534a4289c5898df8120065073653057e523c4a790a05e8e6/googleapis/python-spanner-sqlalchemy/issues/301 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/063c25f5833af970534a4289c5898df8120065073653057e523c4a790a05e8e6/googleapis/python-spanner-sqlalchemy/issues/301 |
| og:image:alt | Hello, I am trying to read data from a spanner table that currently has 134.964 rows and 288 columns. I have been using the example posted in the Github under "Read" and modying the query to read l... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Joselguti |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2981c597c945c1d90ac6fa355ce7929b2f413dfe7872ca5c435ee53a24a1de50 |
| turbo-cache-control | no-preview |
| go-import | github.com/googleapis/python-spanner-sqlalchemy git https://github.com/googleapis/python-spanner-sqlalchemy.git |
| octolytics-dimension-user_id | 16785467 |
| octolytics-dimension-user_login | googleapis |
| octolytics-dimension-repository_id | 335511641 |
| octolytics-dimension-repository_nwo | googleapis/python-spanner-sqlalchemy |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 335511641 |
| octolytics-dimension-repository_network_root_nwo | googleapis/python-spanner-sqlalchemy |
| 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 | 520b65a872113b919c1bbdb03834a50af15859fd |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width