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

CREATE TABLE leaves /tmp/presto-{USER}/xxx #4868

Closed
byungnam opened this issue Aug 18, 2020 · 3 comments
Closed

CREATE TABLE leaves /tmp/presto-{USER}/xxx #4868

byungnam opened this issue Aug 18, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@byungnam
Copy link

byungnam commented Aug 18, 2020

Problem

While using Presto, I found 1 million of /tmp/presto-{USER}/xxx directories and my Hadoop namenode is complaining about it: The directory item limit of /tmp/presto-**** is exceeded.

It seems something went wrong and the directory is not cleaned up.

Presto version

331

How to reproduce

Actually, no idea.

Not sure but we have many Presto query failures in some circumstances including when upgrading and restarting Presto, Hive fails to write HDFS (due to heavy IO), Presto worker fails (OOM is observed). So that could be a reason maybe?

ref: Slack thread link

@findepi findepi added the bug Something isn't working label Aug 20, 2020
@byungnam
Copy link
Author

byungnam commented Sep 16, 2021

I found the cause of this behavior. It's still happening from Trino 355.

EDIT: This was not the cause. See the following comment.

How to reproduce:

  1. Call call system.create_empty_partition()
  2. Above call fails (due to partition already exists)

Example:
Call this

call system.create_empty_partition(schema_name => 'toros_analysis', table_name => 'o_aurochs_feedback_log', partition_columns => ARRAY['date_hour'], partition_values => ARRAY['2021091610'])

and fails with

io.trino.spi.TrinoException: Partition already exists
	at io.trino.plugin.hive.procedure.CreateEmptyPartitionProcedure.doCreateEmptyPartition(CreateEmptyPartitionProcedure.java:125)
	at io.trino.plugin.hive.procedure.CreateEmptyPartitionProcedure.createEmptyPartition(CreateEmptyPartitionProcedure.java:102)
	at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:710)
	at java.base/java.lang.invoke.MethodHandle.invokeWithArguments(MethodHandle.java:735)
	at io.trino.execution.CallTask.execute(CallTask.java:194)
	at io.trino.execution.CallTask.execute(CallTask.java:67)
	at io.trino.execution.DataDefinitionExecution.start(DataDefinitionExecution.java:170)
	at io.trino.execution.SqlQueryManager.createQuery(SqlQueryManager.java:237)
	at io.trino.dispatcher.LocalDispatchQuery.lambda$startExecution$7(LocalDispatchQuery.java:143)
	at io.trino.$gen.Trino_355_kakao____20210906_064002_2.run(Unknown Source)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)

then the /tmp/presto-{USER}/xxx directory is created but not removed.

drwxrwxrwx   - gony-noreply hadoop          0 2021-09-16 10:20 /tmp/presto-gony-noreply/5f4a14e7-3785-4036-aa1d-3fb18705e20b

@findepi findepi changed the title /tmp/presto-{USER} is not cleaned up create_empty_partition() leaves /tmp/presto-{USER}/xxx when partition already exists Sep 16, 2021
@byungnam
Copy link
Author

byungnam commented Sep 23, 2021

EDIT: It's CREATE TABLE statement not create_empty_partition

Reproduce steps:

  • Run CREATE TABLE statement

@byungnam byungnam changed the title create_empty_partition() leaves /tmp/presto-{USER}/xxx when partition already exists CREATE TABLE leaves /tmp/presto-{USER}/xxx Sep 23, 2021
@byungnam
Copy link
Author

fixed by: #14830

@byungnam byungnam closed this as not planned Won't fix, can't repro, duplicate, stale Jul 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Development

No branches or pull requests

2 participants