prestodb/presto · error · PrestoException

ICEBERG_ROLLBACK_ERROR

ICEBERG_ROLLBACK_ERROR

Error message

Exception during rollback

What it means

When a delete sink is aborted, IcebergDeletePageSink rolls back the underlying position-delete file writer. If that rollback itself throws, the original abort failure is replaced by this ICEBERG_ROLLBACK_ERROR exception; the delete file may be left in an inconsistent/partial state.

Source

Thrown at presto-iceberg/src/main/java/com/facebook/presto/iceberg/delete/IcebergDeletePageSink.java:169

                dataFile,
                POSITION_DELETES);

        commitTasks.add(wrappedBuffer(jsonCodec.toJsonBytes(task)));

        writtenBytes = writer.getWrittenBytes();
        validationCpuNanos = writer.getValidationCpuNanos();

        return completedFuture(commitTasks.build());
    }

    @Override
    public void abort()
    {
        try {
            positionDeleteWriter.getWriter().rollback();
        }
        catch (Throwable t) {
            throw new PrestoException(ICEBERG_ROLLBACK_ERROR, "Exception during rollback");
        }
    }

    private class IcebergPositionDeleteWriter
    {
        private final Schema positionDeleteSchema = new Schema(DELETE_FILE_PATH, DELETE_FILE_POS);
        private final IcebergFileWriter writer;

        public IcebergPositionDeleteWriter()
        {
            this.writer = createWriter();
        }

        /**
         * @param page Only one channel. It contains the list of row positions to delete.
         */
        public void appendPage(Page page)
        {

View on GitHub (pinned to 55bb57d202)

Solutions

  1. Inspect the swallowed cause: add the Throwable as the cause or log it to find the real rollback failure.
  2. Ensure abort() is not called after close()/commit on the same writer.
  3. Check filesystem permissions and connectivity for the delete-file location; orphan files can be cleaned via Iceberg's expire/cleanup procedures.

Example fix

// before
throw new PrestoException(ICEBERG_ROLLBACK_ERROR, "Exception during rollback");
// after
throw new PrestoException(ICEBERG_ROLLBACK_ERROR, "Exception during rollback", t); // keep root cause
Defensive patterns

Strategy: try-catch

Try / catch

try { sink.abort(); } catch (PrestoException e) { if (e.getErrorCode() == ICEBERG_ROLLBACK_ERROR.toErrorCode()) { /* schedule orphan-file cleanup; inspect writer state */ } throw e; }

Prevention

When it happens

Trigger: Calling abort() on the IcebergDeletePageSink when positionDeleteWriter.getWriter().rollback() fails — e.g. the writer was already closed, the underlying file handle/FS is broken, or the underlying writer threw its own exception earlier.

Common situations: Query failures triggering abort with an already-failed writer; HDFS/S3 connectivity problems during cleanup; double-abort paths.

Related errors


AI-assisted analysis of prestodb/presto@55bb57d202 (2026-09-04). Data as JSON: /api/errors/f11ce6edf3df673f. Report an issue: GitHub.