george-zubrienko opened a new issue, #1195:
URL: https://github.com/apache/polaris/issues/1195

   ### Describe the bug
   
   When a table is dropped using DROP_WITH_PURGE (default in Trino connector), 
Polaris fails to drop the table data from the underlying storage, throwing this:
   
   ```
   2025-03-18 12:46:24,760 INFO  [org.apa.pol.ser.tas.TaskExecutorImpl] [,] 
[00000000000000000000000000000000,,0000000000000000,false] (executor-thread-1) 
Handling task entity id 155
   2025-03-18 12:46:24,855 INFO  [org.apa.pol.ser.tas.TableCleanupTaskHandler] 
[,] [00000000000000000000000000000000,,0000000000000000,false] 
(executor-thread-1) tableIdentifier=d365_eu.test 
metadataLocation=s3://.../metadata/00001-a8283615-e997-490a-8c48-28d75a02f29b.metadata.json
 Handling table metadata cleanup task
   2025-03-18 12:46:24,856 INFO  [org.apa.ice.CatalogUtil] [,] 
[00000000000000000000000000000000,,0000000000000000,false] (executor-thread-1) 
Loading custom FileIO implementation: org.apache.iceberg.aws.s3.S3FileIO
   [EL Warning]: 2025-03-18 12:46:24.944--UnitOfWork(169674653)--Exception 
[EclipseLink-4002] (Eclipse Persistence Services - 
4.0.5.v202412231137-a96b873527f305f932543045c8679bb1de8d3a43): 
org.eclipse.persistence.exceptions.DatabaseException
   Internal Exception: org.postgresql.util.PSQLException: ERROR: value too long 
for type character varying(255)
   Error Code: 0
   Call: INSERT INTO ENTITIES (CATALOGID, ID, CREATETIMESTAMP, DROPTIMESTAMP, 
ENTITYVERSION, GRANTRECORDSVERSION, INTERNALPROPERTIES, LASTUPDATETIMESTAMP, 
NAME, PARENTID, PROPERTIES, PURGETIMESTAMP, SUBTYPECODE, TOPURGETIMESTAMP, 
TYPECODE, VERSION) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
        bind => [16 parameters bound]
   Query: InsertObjectQuery(org.apache.polaris.jpa.models.ModelEntity@ee2670d)
   2025-03-18 12:46:26,945 WARN  [org.apa.pol.ser.tas.TaskExecutorImpl] [,] 
[,,,] (executor-thread-1) Failed to handle task entity id 155: 
java.util.concurrent.CompletionException: 
jakarta.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse 
Persistence Services - 
4.0.5.v202412231137-a96b873527f305f932543045c8679bb1de8d3a43): 
org.eclipse.persistence.exceptions.DatabaseException
   Internal Exception: org.postgresql.util.PSQLException: ERROR: value too long 
for type character varying(255)
   Error Code: 0
   Call: INSERT INTO ENTITIES (CATALOGID, ID, CREATETIMESTAMP, DROPTIMESTAMP, 
ENTITYVERSION, GRANTRECORDSVERSION, INTERNALPROPERTIES, LASTUPDATETIMESTAMP, 
NAME, PARENTID, PROPERTIES, PURGETIMESTAMP, SUBTYPECODE, TOPURGETIMESTAMP, 
TYPECODE, VERSION) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
        bind => [16 parameters bound]
   Query: InsertObjectQuery(org.apache.polaris.jpa.models.ModelEntity@ee2670d)
        at 
java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:315)
        at 
java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:320)
        at 
java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1807)
        at 
io.smallrye.context.impl.wrappers.SlowContextualRunnable.run(SlowContextualRunnable.java:19)
        at 
org.jboss.threads.EnhancedViewExecutor$EnhancedViewExecutorRunnable.run(EnhancedViewExecutor.java:501)
        at 
io.quarkus.vertx.core.runtime.VertxCoreRecorder$15.runWith(VertxCoreRecorder.java:643)
        at 
org.jboss.threads.EnhancedQueueExecutor$Task.doRunWith(EnhancedQueueExecutor.java:2675)
        at 
org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2654)
        at 
org.jboss.threads.EnhancedQueueExecutor.runThreadBody(EnhancedQueueExecutor.java:1627)
        at 
org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1594)
        at org.jboss.threads.DelegatingRunnable.run(DelegatingRunnable.java:11)
        at 
org.jboss.threads.ThreadLocalResettingRunnable.run(ThreadLocalResettingRunnable.java:11)
        at 
io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
        at java.base/java.lang.Thread.run(Thread.java:1583)
   Caused by: jakarta.persistence.PersistenceException: Exception 
[EclipseLink-4002] (Eclipse Persistence Services - 
4.0.5.v202412231137-a96b873527f305f932543045c8679bb1de8d3a43): 
org.eclipse.persistence.exceptions.DatabaseException
   Internal Exception: org.postgresql.util.PSQLException: ERROR: value too long 
for type character varying(255)
   Error Code: 0
   ```
   
   ### To Reproduce
   
   1. Have a working setup with Trino using Polaris as Iceberg REST catalog, S3 
as a backing store, and make sure principal used has both TABLE_DROP and 
TABLE_WRITE_DATA permissions
   2. Create a table from Trino: `create table mycatalog.myschema.test as 
select 'a' as colA`
   3. Confirm table creation by running `select * from mycatalog.myschema.test`
   4. Drop the table: `drop table mycatalog.myschema.test`
   
   ### Actual Behavior
   
   Table is removed from catalog, but data is not purged from S3, error printed 
to logs
   
   ### Expected Behavior
   
   Data is purged
   
   ### Additional context
   
   _No response_
   
   ### System information
   
   Polaris v0.9 with commit from Mar 17, built with Postgres Eclipse Link for 
container. Postgres database is Aurora Serverless 15.10, bootstrapped with 
Admin tool of the same version.
   
   `./gradlew clean :polaris-quarkus-server:assemble 
-Dquarkus.container-image.build=true --no-build-cache -PeclipseLink=true 
-PeclipseLinkDeps=org.postgresql:postgresql:42.7.4`
   `./gradlew clean :polaris-quarkus-admin:build 
-Dquarkus.container-image.build=true --no-build-cache 
-PeclipseLinkDeps=org.postgresql:postgresql:42.7.4`
   
   Installed in EKS 1.29 via Helm chart built from the same commit.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to