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

The application hangs after 30 minutes for long running PDML #832

Open
yuanyuan-gl opened this issue Sep 28, 2022 · 4 comments
Open

The application hangs after 30 minutes for long running PDML #832

yuanyuan-gl opened this issue Sep 28, 2022 · 4 comments
Assignees
Labels
api: spanner Issues related to the googleapis/python-spanner API.

Comments

@yuanyuan-gl
Copy link

yuanyuan-gl commented Sep 28, 2022

There is an internal bug opened for this and potentially a fix in https://github.com/asthamohta/python-spanner/tree/retry-error. But it is not confirmed yet, so want to open this in github issue to track it and just in case it is not recorded.

No exception thrown up with following code using python google-cloud-spanner==3.19.0 running on GCE instance, the script just hangs after 30 minutes and the deletion stopped after 30 minutes

from google.cloud import spanner
from google.cloud.spanner_v1 import RequestOptions
import sys

def run(query: str, instance_id: str, database_id: str, project: str):
    try:
        spanner_client = spanner.Client(project=project)
        database = spanner_client.instance(instance_id).database(database_id)
        print(f"Connected to database {instance_id}/{database_id}")
        print(f"Running query: {query}")
        request_options = RequestOptions({"priority": RequestOptions.Priority.PRIORITY_HIGH,"transaction_tag": "delete transaction tag","request_tag": "delete request tag"})
        row_ct = database.execute_partitioned_dml(query, request_options=request_options)
        print(f"{row_ct} records updated.")
    except Exception as e:
        print(e)


if __name__ == "__main__":
    query = sys.argv[4]
    project = sys.argv[1]
    instance = sys.argv[2]
    database = sys.argv[3]
    run(query, instance, database, project)
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/python-spanner API. label Sep 28, 2022
@yuanyuan-gl
Copy link
Author

Just clarify, the script just hangs after 30 minutes and the deletion also stops after 30 minutes.

@anpjai
Copy link

anpjai commented Jan 11, 2023

Is there an update on this. I am trying to delete 200m rows and seems to get different results.
some times it succeeds.
more than often it fails with timeout or deadline exceeded error.

@dakshinrajavel
Copy link

dakshinrajavel commented Jan 13, 2023

I face the similar issue when I run a plain SQL from terminal
gcloud spanner databases execute-sql XXXX
--instance=my-dev-instance
--sql="delete * from mytable where id ='1234';"
This involves deleting 300million rows.
I tried running this on nohup as well.
No error, but I don't see the delete happening after some 30 minutes.
When are we expecting a fix for this

@Hackeron
Copy link

Hackeron commented Apr 3, 2024

Hello @asthamohta,
I am also facing the similar issue.

Is there any timeline for this issue to get resolved?
I see this issue is open since long time and with no action.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/python-spanner API.
Projects
None yet
Development

No branches or pull requests

7 participants