You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Chasing weird bug. Presto ( has an operation: create table as (select ...). During this operation it creates a tmp folder on GCS and writes intermediate results there. After all files are completed, it moves those files into the destination using rename operation.
2020-03-26T20:29:45.941-0700 INFO gcsfs-batch-helper-8 com.google.cloud.hadoop.gcsio.GoogleCloudStorageImpl Precondition not met while deleting 'gs:/bucket/mp/user/6c5e9a11-49c5-4558-bbab-525f9e9a5f1d/' at generation 0. Attempt 1. Retrying:
{"code":412,"errors":[{"domain":"global","location":"If-Match","locationType":"header","message":"Precondition Failed","reason":"conditionNotMet"}],"message":"Precondition Failed"}
2020-03-26T20:29:46.008-0700 INFO gcsfs-batch-helper-8 com.google.cloud.hadoop.gcsio.GoogleCloudStorageImpl Precondition not met while deleting 'gs://bucket/tmp/user_name/6c5e9a11-49c5-4558-bbab-525f9e9a5f1d/' at generation 0. Attempt 2. Retrying:
{"code":412,"errors":[{"domain":"global","location":"If-Match","locationType":"header","message":"Precondition Failed","reason":"conditionNotMet"}],"message":"Precondition Failed"}
The reason is that with setPerformanceCacheEnabled(true) the connector is caching response of the: fs.getFileInfo('/tmp/folder') when /tmp/folder doesn't exist. So, Presto calls this check, sees that folder doesn't exist, creates it, then tries to delete and fails as generationId=0 is passed into the delete operation (and 0 is coming from cached operation which doesn't find the file)
In general, if we check whether the folder exists before creating it, and then execute write and rename before cache expires, rename will fail. Have a very simple test case.
The text was updated successfully, but these errors were encountered:
afilipchik
changed the title
PrestoSql is failing to rename /tmp folder
PrestoSql is failing to rename /tmp folder when PerformanceCacheEnabled is set to true
Mar 27, 2020
Chasing weird bug. Presto ( has an operation:
create table as (select ...)
. During this operation it creates a tmp folder on GCS and writes intermediate results there. After all files are completed, it moves those files into the destination using rename operation.The reason is that with
setPerformanceCacheEnabled(true)
the connector is caching response of the:fs.getFileInfo('/tmp/folder')
when/tmp/folder
doesn't exist. So, Presto calls this check, sees that folder doesn't exist, creates it, then tries to delete and fails asgenerationId=0
is passed into the delete operation (and0
is coming from cached operation which doesn't find the file)In general, if we check whether the folder exists before creating it, and then execute write and rename before cache expires, rename will fail. Have a very simple test case.
The text was updated successfully, but these errors were encountered: