You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@polaris.apache.org by Prithvi S <pr...@gmail.com> on 2026/09/18 02:24:57 UTC
[DISCUSS] opt-in table soft-delete
Hi all,
I'd like to start a discussion on opt-in table soft-delete, hold period,
and later undrop: https://github.com/apache/polaris/issues/5054
Polaris DROP is hard from the catalog's point of view: the active name
disappears, and there is no hold period or undrop. Operators who need a
recoverable drop (compliance / legal hold, Nessie-to-Polaris migration)
invent workarounds that Iceberg REST clients can bypass.
The change is opt-in and default-off, so catalogs that want today's hard
DROP keep it.
Thanks to Dmitri for looking at this earlier. His suggestion was that name
reuse after soft-delete should be blocked until tables have unique
locations (PR #4606), because shared locations plus a recreated table
interact badly with staged-create credential refresh.
#4606 has merged, but unique locations are still off by default, existing
tables are unchanged, and client-specified locations are still allowed. So
"all tables have unique locations" is not true today, and I do not want
#5054 to wait on that migration.
The original GitHub issue freed the table name as soon as the table was
soft-deleted, so a drop-and-recreate ETL job could create the same
identifier again during the hold. I now think that is the wrong default for
an opt-in hold/recover feature:
* A legal-hold table should not share its identifier with a new live
table.
* Undrop is unambiguous if the name is still reserved.
* Drop-and-recreate ETL is unchanged on catalogs that leave the feature
off (the default). Catalogs that enable it can DROP PURGE when they truly
want the name back immediately.
Phase 1 (default off): Catalog-scoped, INTERNAL Iceberg tables only.
Disabled catalogs keep
today's DROP behavior.
* DROP without purge -> soft-delete: entity retained, metadata location
retained, data/metadata files not deleted.
* Soft-deleted tables are not listable or loadable on normal Iceberg REST
paths.
* The identifier stays reserved for the hold period (default 7 days).
CREATE / register with the same name fails until permanent delete or a
later undrop.
* DROP PURGE on a live table remains immediate permanent delete, using
the existing cleanup path.
* After the hold, the next list/create/drop-namespace in that namespace
permanently deletes catalog state. File cleanup is opt-in (default off) and
uses today's ENTITY_CLEANUP_SCHEDULER.
* No new Iceberg REST undrop. No change to unique-location defaults.
* No new privileges in Phase 1: soft-drop uses TABLE_DROP; purge keeps
the current drop-with-purge authorization.
Persistence: in-place dropped entity with dropTimestamp / toPurgeTimestamp,
filtered out of the active resolve/list path. Do not revive the old
entitiesDropped SPI.
Phase 2: List soft-deleted tables and undrop, with new privileges. Name
reuse after soft-delete only if/when a catalog actually has unique
locations for every table.
out of scope for this thread:
* Staged-create credential refresh
* Flipping DEFAULT_UNIQUE_TABLE_LOCATION_ENABLED default
questions:
1. Is reserving the identifier during the hold acceptable for Phase 1,
instead of freeing the table name on soft-delete?
2. Is it correct that DROP PURGE stays "destroy now", and only DROP
without purge enters the hold?
I opened a draft PR for Phase 1: https://github.com/apache/polaris/pull/5544
Thanks,
Prithvi S
Re: [DISCUSS] opt-in table soft-delete
Posted by Yufei Gu <fl...@gmail.com>.
Thanks Prithvi for the proposal. Could you provide more details about the
following use case described in the issue 5054?
"Compliance / legal hold: Dropped tables must remain recoverable for a
defined period before catalog state and data are permanently destroyed."
Yufei
On Sat, Sep 19, 2026 at 1:43 AM Prithvi S <pr...@gmail.com>
wrote:
> Hi JB, Dmitri,
>
> Thanks for the replies, and thanks Dmitri for looking at the draft PR.
>
> JB, on eviction: Phase 1 is lazy on namespace access, not a scheduled
> sweep.
> When TABLE_SOFT_DELETE_ENABLED is false (the default), expiration is a
> no-op: a catalog config check only. Catalogs that keep hard DROP do not
> scan held tables.
> When it is enabled, the next list, create, or drop-namespace in that
> namespace lists Iceberg tables under it (live and dropped) and permanently
> deletes those whose toPurgeTimestamp has passed. Catalog state is always
> removed then. File cleanup is a separate flag and uses the existing
> ENTITY_CLEANUP_SCHEDULER. There is no dedicated expiration task, and no
> purge-now API, in Phase 1 :)
> So the cost you asked about only applies to catalogs that opt in. A
> namespace with many held tables then pays a full Iceberg-table listing on
> those operations. I documented that on TABLE_SOFT_DELETE_HOLD_PERIOD in the
> draft PR. A scheduled sweep can wait until we know whether lazy-on-access
> is enough.
>
> Dmitri also noted on the PR that leaving files in place after expire, then
> freeing the name, can let a recreated table see leftover data until unique
> locations are enforced. The DISCUSS default was file cleanup off so expire
> matches DROP without purge. If Phase 1 should always enqueue entity-cleanup
> when a soft-deleted table is permanently deleted, I can change the draft.
>
> Thanks,
> Prithvi S
>
> On Sat, Sep 19, 2026 at 5:54 AM Dmitri Bourlatchkov <di...@apache.org>
> wrote:
>
> > Hi Prithvi,
> >
> > The proposed two phase approach sounds reasonable to me. I'll try and
> > review the PR ASAP.
> >
> > Cheers,
> > Dmitri.
> >
> > On Thu, Sep 17, 2026 at 10:25 PM Prithvi S <pr...@gmail.com>
> > wrote:
> >
> > > Hi all,
> > >
> > > I'd like to start a discussion on opt-in table soft-delete, hold
> period,
> > > and later undrop: https://github.com/apache/polaris/issues/5054
> > >
> > > Polaris DROP is hard from the catalog's point of view: the active name
> > > disappears, and there is no hold period or undrop. Operators who need a
> > > recoverable drop (compliance / legal hold, Nessie-to-Polaris migration)
> > > invent workarounds that Iceberg REST clients can bypass.
> > >
> > > The change is opt-in and default-off, so catalogs that want today's
> hard
> > > DROP keep it.
> > >
> > > Thanks to Dmitri for looking at this earlier. His suggestion was that
> > name
> > > reuse after soft-delete should be blocked until tables have unique
> > > locations (PR #4606), because shared locations plus a recreated table
> > > interact badly with staged-create credential refresh.
> > >
> > > #4606 has merged, but unique locations are still off by default,
> existing
> > > tables are unchanged, and client-specified locations are still allowed.
> > So
> > > "all tables have unique locations" is not true today, and I do not want
> > > #5054 to wait on that migration.
> > >
> > > The original GitHub issue freed the table name as soon as the table was
> > > soft-deleted, so a drop-and-recreate ETL job could create the same
> > > identifier again during the hold. I now think that is the wrong default
> > for
> > > an opt-in hold/recover feature:
> > > * A legal-hold table should not share its identifier with a new live
> > > table.
> > > * Undrop is unambiguous if the name is still reserved.
> > > * Drop-and-recreate ETL is unchanged on catalogs that leave the
> feature
> > > off (the default). Catalogs that enable it can DROP PURGE when they
> truly
> > > want the name back immediately.
> > >
> > > Phase 1 (default off): Catalog-scoped, INTERNAL Iceberg tables only.
> > > Disabled catalogs keep
> > > today's DROP behavior.
> > > * DROP without purge -> soft-delete: entity retained, metadata
> location
> > > retained, data/metadata files not deleted.
> > > * Soft-deleted tables are not listable or loadable on normal Iceberg
> > REST
> > > paths.
> > > * The identifier stays reserved for the hold period (default 7 days).
> > > CREATE / register with the same name fails until permanent delete or a
> > > later undrop.
> > > * DROP PURGE on a live table remains immediate permanent delete,
> using
> > > the existing cleanup path.
> > > * After the hold, the next list/create/drop-namespace in that
> namespace
> > > permanently deletes catalog state. File cleanup is opt-in (default off)
> > and
> > > uses today's ENTITY_CLEANUP_SCHEDULER.
> > > * No new Iceberg REST undrop. No change to unique-location defaults.
> > > * No new privileges in Phase 1: soft-drop uses TABLE_DROP; purge
> keeps
> > > the current drop-with-purge authorization.
> > >
> > > Persistence: in-place dropped entity with dropTimestamp /
> > toPurgeTimestamp,
> > > filtered out of the active resolve/list path. Do not revive the old
> > > entitiesDropped SPI.
> > >
> > > Phase 2: List soft-deleted tables and undrop, with new privileges. Name
> > > reuse after soft-delete only if/when a catalog actually has unique
> > > locations for every table.
> > >
> > > out of scope for this thread:
> > > * Staged-create credential refresh
> > > * Flipping DEFAULT_UNIQUE_TABLE_LOCATION_ENABLED default
> > >
> > > questions:
> > > 1. Is reserving the identifier during the hold acceptable for Phase
> 1,
> > > instead of freeing the table name on soft-delete?
> > > 2. Is it correct that DROP PURGE stays "destroy now", and only DROP
> > > without purge enters the hold?
> > >
> > > I opened a draft PR for Phase 1:
> > > https://github.com/apache/polaris/pull/5544
> > >
> > > Thanks,
> > > Prithvi S
> > >
> >
>
Re: [DISCUSS] opt-in table soft-delete
Posted by Dmitri Bourlatchkov via dev <de...@polaris.apache.org>.
Hi Alex
> - The resolver hides dropped entities. [...]
Thanks for flagging this.
I tend to think that the Resolver should not hide anything because it is a
critical piece in ensuing catalog consistency with respect to the Entity
Cache.
If the Resolver is a convenient place to enforce soft-deleted states,
perhaps we could do that during the "get" calls, while still allowing the
soft-deleted entities to be resolved normally.
The request signer could then use a different getter method returning all
resolved entities.
> - Which policy makes sense for deletes during the hold?
I think we should block file removal for soft-deleted entities where we
can. It seems possible with request signing.
Cheers,
Dmitri.
On Fri, Nov 13, 2026 at 11:55 AM Alex Dutra via dev <de...@polaris.apache.org>
wrote:
> Hi Prithvi, hi all,
>
> Two points from the remote signing work that relate to this proposal.
>
> 1. Spark's DROP TABLE ... PURGE is a drop without purge.
>
> Spark doesn't ask the catalog to purge:
>
> - It loads the table and calls the catalog's drop with purge=false.
> - It then deletes the table's files itself, through the table's FileIO.
>
> With Spark, the catalog never sees a purge. On a catalog with
> soft-delete enabled, a Spark DROP TABLE ... PURGE would:
>
> - put the table on hold, with its name reserved, even though the user
> asked for a purge;
> - delete its files right away from the client.
>
> The hold would then keep a table whose files are gone, which matters
> once recovery is added. With vended credentials, Polaris can't see or
> prevent those deletes. This might be worth documenting.
>
> 2. Soft-delete would help remote signing.
>
> I'm reviving S3 remote signing. Polaris authorizes each sign request
> against the table, so it does see those deletes. Today, after a drop,
> the table and its grants are gone. My current approach records the
> principal's DROP_TABLE_WITH_PURGE decision in the remote signing token
> when the table is loaded. After the drop, it then allows only reads
> and deletes within the table's locations.
>
> In [5544], a soft-deleted table keeps its row, id and grants. So for
> those tables Polaris could:
>
> - authorize the deletes against the table itself when they happen,
> instead of relying on a decision recorded at load time;
> - choose a policy for the hold: either allow the deletes, since the
> client asked for a purge, or refuse them, so the table stays
> recoverable. Only remote signing makes the second option possible.
>
> Two questions:
>
> - Which policy makes sense for deletes during the hold?
> - The resolver hides dropped entities. Would an option to resolve a
> soft-deleted table, for this purpose only, be acceptable?
>
> Neither point should block Phase 1. I just want to make sure the two
> features fit together.
>
> Thanks,
> Alex
>
> [5544]: https://github.com/apache/polaris/pull/5544
>
>
> On Thu, Nov 12, 2026 at 12:44 AM Dmitri Bourlatchkov via dev
> <de...@polaris.apache.org> wrote:
> >
> > Hi Prithvi and all,
> >
> > I did another review round in GH.
> >
> > Re-posting here the key comment: I'm very hesitant about
> > expiring soft-deleted entities during REST requests against other
> entities.
> > I think the resulting behaviours are too "magical" from the end user's
> > perspective.
> >
> > I believe the expiry use case belongs more naturally in the Admin Tool
> > given the current codebase. Eventually it could also be handled by the
> > delegation service [3990].
> >
> > WDYT?
> >
> > Thanks,
> > Dmitri.
> > [3990] https://github.com/apache/polaris/pull/3990
> >
> > On Mon, Oct 26, 2026 at 4:34 PM Prithvi S <pr...@gmail.com>
> > wrote:
> >
> > > Hi all,
> > >
> > > Quick follow-up on the cleanup gating for Phase 1:
> > > holding the identifier until the entity cleanup and its
> > > child tasks finish, then releasing it.
> > >
> > > While implementing this, I found that the coupling is
> > > in the metastore manager. dropEntityIfExists removes
> > > the entity (freeing the name) and schedules the cleanup
> > > task in the same transaction, by design.
> > >
> > > To keep the name reserved until cleanup completes, I'd
> > > need to separate these operations: keep the dropped
> > > entity, schedule cleanup, and remove the entity only
> > > after the cleanup task and its child tasks have finished.
> > >
> > > We don't currently have a way to detect when a task
> > > tree has completed. Tasks are fire-and-forget and
> > > self-remove on success, so I'd also need to add a small
> > > completion check.
> > >
> > > This touches PolarisMetaStoreManager, which has both
> > > JDBC (atomic and transactional) and NoSQL
> > > implementations. I wanted to check the direction before
> > > coding, in line with our interface-change guidance.
> > >
> > > Does keeping the entity reserved and gating its removal
> > > on cleanup completion sound right, or would you prefer
> > > a different approach, such as a dedicated purge task
> > > that handles the final entity removal?
> > >
> > > Thanks,
> > > Prithvi
> > >
> > > >
> > >
>
Re: [DISCUSS] opt-in table soft-delete
Posted by Dmitri Bourlatchkov via dev <de...@polaris.apache.org>.
Hi Alex,
> leave room for 3 values: STAGED, LIVE, DELETED [...]
This is a nice idea! I think it is a promising avenue to explore for
supporting reliable location overlap checks and credential refresh for
staged creates.
Cheers,
Dmitri.
On Tue, Nov 17, 2026 at 7:16 AM Alex Dutra via dev <de...@polaris.apache.org>
wrote:
> Hi all,
>
> A correction to my previous message, and a few suggestions:
>
> 1) Spark can ask the catalog to purge. Since Iceberg 1.12, Spark has a
> catalog option, rest-catalog-purge, off by default. When set to true,
> Spark deletes no files itself. Without the option, which includes all
> earlier Iceberg versions, my previous point stands though: Spark drops
> without purge, then deletes the files itself. Recommending
> rest-catalog-purge=true for catalogs with soft delete enabled seems
> worth documenting in [5544].
>
> 2) But catalogs can also ask clients not to delete files. Iceberg
> Java's S3FileIO has a property, s3.delete-enabled. When a catalog sets
> this property to false, S3FileIO silently skips deletes.
> Interestingly, Lakekeeper does this by default for warehouses with
> soft deletion enabled. Should Polaris do something similar? This
> property has a few drawbacks, the biggest one being that it disables
> all client-side deletes, including on live tables (i.e., when running
> expire_snapshots or remove_orphan_files). Therefore, it only makes
> sense to send that property **if the catalog handles all file
> deletions server-side**, including snapshot expirations, which Polaris
> doesn't do today. (Lakekeeper does that in its commercial offering
> only, afaict; for the open-source edition, the documentation tells
> users to override s3.delete-enabled=true in their Spark configuration
> for maintenance jobs.) All of this to say, pushing
> s3.delete-enabled=false could be an opt-in later, but for that Polaris
> should first implement a proper snapshot expiry service.
>
> 3) I would like to introduce soft-creations too, for staged table
> creations. IOW, the table would be in 3 possible states: STAGED, LIVE,
> DELETED. Today a staged table isn't persisted until the transaction
> commits, so Polaris has nothing to hold its locations or to authorize
> against in the meantime. A persisted STAGED entity would:
>
> - hold its locations and reserve its name, like a soft-deleted table;
> - let remote signing authorize against the entity instead of a token;
> - let Polaris clean up abandoned creates.
>
> It would require keeping the entity invisible to list and load until
> it commits, and an expiry service for abandoned entries, much like the
> hold for soft-deleted tables in [5544]. It also changes concurrent
> creates of the same name to fail at staging time rather than at commit
> time, which I believe is a net improvement.
>
> I'm not suggesting we do all this for Phase 1, only that the state
> model should leave room for 3 values: STAGED, LIVE, DELETED.
>
> WDYT?
>
> Thanks,
> Alex
>
> [5544]: https://github.com/apache/polaris/pull/5544
>
> On Fri, Nov 13, 2026 at 5:54 PM Alex Dutra <ad...@apache.org> wrote:
> >
> > Hi Prithvi, hi all,
> >
> > Two points from the remote signing work that relate to this proposal.
> >
> > 1. Spark's DROP TABLE ... PURGE is a drop without purge.
> >
> > Spark doesn't ask the catalog to purge:
> >
> > - It loads the table and calls the catalog's drop with purge=false.
> > - It then deletes the table's files itself, through the table's FileIO.
> >
> > With Spark, the catalog never sees a purge. On a catalog with
> > soft-delete enabled, a Spark DROP TABLE ... PURGE would:
> >
> > - put the table on hold, with its name reserved, even though the user
> > asked for a purge;
> > - delete its files right away from the client.
> >
> > The hold would then keep a table whose files are gone, which matters
> > once recovery is added. With vended credentials, Polaris can't see or
> > prevent those deletes. This might be worth documenting.
> >
> > 2. Soft-delete would help remote signing.
> >
> > I'm reviving S3 remote signing. Polaris authorizes each sign request
> > against the table, so it does see those deletes. Today, after a drop,
> > the table and its grants are gone. My current approach records the
> > principal's DROP_TABLE_WITH_PURGE decision in the remote signing token
> > when the table is loaded. After the drop, it then allows only reads
> > and deletes within the table's locations.
> >
> > In [5544], a soft-deleted table keeps its row, id and grants. So for
> > those tables Polaris could:
> >
> > - authorize the deletes against the table itself when they happen,
> > instead of relying on a decision recorded at load time;
> > - choose a policy for the hold: either allow the deletes, since the
> > client asked for a purge, or refuse them, so the table stays
> > recoverable. Only remote signing makes the second option possible.
> >
> > Two questions:
> >
> > - Which policy makes sense for deletes during the hold?
> > - The resolver hides dropped entities. Would an option to resolve a
> > soft-deleted table, for this purpose only, be acceptable?
> >
> > Neither point should block Phase 1. I just want to make sure the two
> > features fit together.
> >
> > Thanks,
> > Alex
> >
> > [5544]: https://github.com/apache/polaris/pull/5544
> >
> >
> > On Thu, Nov 12, 2026 at 12:44 AM Dmitri Bourlatchkov via dev
> > <de...@polaris.apache.org> wrote:
> > >
> > > Hi Prithvi and all,
> > >
> > > I did another review round in GH.
> > >
> > > Re-posting here the key comment: I'm very hesitant about
> > > expiring soft-deleted entities during REST requests against other
> entities.
> > > I think the resulting behaviours are too "magical" from the end user's
> > > perspective.
> > >
> > > I believe the expiry use case belongs more naturally in the Admin Tool
> > > given the current codebase. Eventually it could also be handled by the
> > > delegation service [3990].
> > >
> > > WDYT?
> > >
> > > Thanks,
> > > Dmitri.
> > > [3990] https://github.com/apache/polaris/pull/3990
> > >
> > > On Mon, Oct 26, 2026 at 4:34 PM Prithvi S <prithvisivasankar@gmail.com
> >
> > > wrote:
> > >
> > > > Hi all,
> > > >
> > > > Quick follow-up on the cleanup gating for Phase 1:
> > > > holding the identifier until the entity cleanup and its
> > > > child tasks finish, then releasing it.
> > > >
> > > > While implementing this, I found that the coupling is
> > > > in the metastore manager. dropEntityIfExists removes
> > > > the entity (freeing the name) and schedules the cleanup
> > > > task in the same transaction, by design.
> > > >
> > > > To keep the name reserved until cleanup completes, I'd
> > > > need to separate these operations: keep the dropped
> > > > entity, schedule cleanup, and remove the entity only
> > > > after the cleanup task and its child tasks have finished.
> > > >
> > > > We don't currently have a way to detect when a task
> > > > tree has completed. Tasks are fire-and-forget and
> > > > self-remove on success, so I'd also need to add a small
> > > > completion check.
> > > >
> > > > This touches PolarisMetaStoreManager, which has both
> > > > JDBC (atomic and transactional) and NoSQL
> > > > implementations. I wanted to check the direction before
> > > > coding, in line with our interface-change guidance.
> > > >
> > > > Does keeping the entity reserved and gating its removal
> > > > on cleanup completion sound right, or would you prefer
> > > > a different approach, such as a dedicated purge task
> > > > that handles the final entity removal?
> > > >
> > > > Thanks,
> > > > Prithvi
> > > >
> > > > >
> > > >
>
Re: [DISCUSS] opt-in table soft-delete
Posted by Alex Dutra via dev <de...@polaris.apache.org>.
Hi all,
A correction to my previous message, and a few suggestions:
1) Spark can ask the catalog to purge. Since Iceberg 1.12, Spark has a
catalog option, rest-catalog-purge, off by default. When set to true,
Spark deletes no files itself. Without the option, which includes all
earlier Iceberg versions, my previous point stands though: Spark drops
without purge, then deletes the files itself. Recommending
rest-catalog-purge=true for catalogs with soft delete enabled seems
worth documenting in [5544].
2) But catalogs can also ask clients not to delete files. Iceberg
Java's S3FileIO has a property, s3.delete-enabled. When a catalog sets
this property to false, S3FileIO silently skips deletes.
Interestingly, Lakekeeper does this by default for warehouses with
soft deletion enabled. Should Polaris do something similar? This
property has a few drawbacks, the biggest one being that it disables
all client-side deletes, including on live tables (i.e., when running
expire_snapshots or remove_orphan_files). Therefore, it only makes
sense to send that property **if the catalog handles all file
deletions server-side**, including snapshot expirations, which Polaris
doesn't do today. (Lakekeeper does that in its commercial offering
only, afaict; for the open-source edition, the documentation tells
users to override s3.delete-enabled=true in their Spark configuration
for maintenance jobs.) All of this to say, pushing
s3.delete-enabled=false could be an opt-in later, but for that Polaris
should first implement a proper snapshot expiry service.
3) I would like to introduce soft-creations too, for staged table
creations. IOW, the table would be in 3 possible states: STAGED, LIVE,
DELETED. Today a staged table isn't persisted until the transaction
commits, so Polaris has nothing to hold its locations or to authorize
against in the meantime. A persisted STAGED entity would:
- hold its locations and reserve its name, like a soft-deleted table;
- let remote signing authorize against the entity instead of a token;
- let Polaris clean up abandoned creates.
It would require keeping the entity invisible to list and load until
it commits, and an expiry service for abandoned entries, much like the
hold for soft-deleted tables in [5544]. It also changes concurrent
creates of the same name to fail at staging time rather than at commit
time, which I believe is a net improvement.
I'm not suggesting we do all this for Phase 1, only that the state
model should leave room for 3 values: STAGED, LIVE, DELETED.
WDYT?
Thanks,
Alex
[5544]: https://github.com/apache/polaris/pull/5544
On Fri, Nov 13, 2026 at 5:54 PM Alex Dutra <ad...@apache.org> wrote:
>
> Hi Prithvi, hi all,
>
> Two points from the remote signing work that relate to this proposal.
>
> 1. Spark's DROP TABLE ... PURGE is a drop without purge.
>
> Spark doesn't ask the catalog to purge:
>
> - It loads the table and calls the catalog's drop with purge=false.
> - It then deletes the table's files itself, through the table's FileIO.
>
> With Spark, the catalog never sees a purge. On a catalog with
> soft-delete enabled, a Spark DROP TABLE ... PURGE would:
>
> - put the table on hold, with its name reserved, even though the user
> asked for a purge;
> - delete its files right away from the client.
>
> The hold would then keep a table whose files are gone, which matters
> once recovery is added. With vended credentials, Polaris can't see or
> prevent those deletes. This might be worth documenting.
>
> 2. Soft-delete would help remote signing.
>
> I'm reviving S3 remote signing. Polaris authorizes each sign request
> against the table, so it does see those deletes. Today, after a drop,
> the table and its grants are gone. My current approach records the
> principal's DROP_TABLE_WITH_PURGE decision in the remote signing token
> when the table is loaded. After the drop, it then allows only reads
> and deletes within the table's locations.
>
> In [5544], a soft-deleted table keeps its row, id and grants. So for
> those tables Polaris could:
>
> - authorize the deletes against the table itself when they happen,
> instead of relying on a decision recorded at load time;
> - choose a policy for the hold: either allow the deletes, since the
> client asked for a purge, or refuse them, so the table stays
> recoverable. Only remote signing makes the second option possible.
>
> Two questions:
>
> - Which policy makes sense for deletes during the hold?
> - The resolver hides dropped entities. Would an option to resolve a
> soft-deleted table, for this purpose only, be acceptable?
>
> Neither point should block Phase 1. I just want to make sure the two
> features fit together.
>
> Thanks,
> Alex
>
> [5544]: https://github.com/apache/polaris/pull/5544
>
>
> On Thu, Nov 12, 2026 at 12:44 AM Dmitri Bourlatchkov via dev
> <de...@polaris.apache.org> wrote:
> >
> > Hi Prithvi and all,
> >
> > I did another review round in GH.
> >
> > Re-posting here the key comment: I'm very hesitant about
> > expiring soft-deleted entities during REST requests against other entities.
> > I think the resulting behaviours are too "magical" from the end user's
> > perspective.
> >
> > I believe the expiry use case belongs more naturally in the Admin Tool
> > given the current codebase. Eventually it could also be handled by the
> > delegation service [3990].
> >
> > WDYT?
> >
> > Thanks,
> > Dmitri.
> > [3990] https://github.com/apache/polaris/pull/3990
> >
> > On Mon, Oct 26, 2026 at 4:34 PM Prithvi S <pr...@gmail.com>
> > wrote:
> >
> > > Hi all,
> > >
> > > Quick follow-up on the cleanup gating for Phase 1:
> > > holding the identifier until the entity cleanup and its
> > > child tasks finish, then releasing it.
> > >
> > > While implementing this, I found that the coupling is
> > > in the metastore manager. dropEntityIfExists removes
> > > the entity (freeing the name) and schedules the cleanup
> > > task in the same transaction, by design.
> > >
> > > To keep the name reserved until cleanup completes, I'd
> > > need to separate these operations: keep the dropped
> > > entity, schedule cleanup, and remove the entity only
> > > after the cleanup task and its child tasks have finished.
> > >
> > > We don't currently have a way to detect when a task
> > > tree has completed. Tasks are fire-and-forget and
> > > self-remove on success, so I'd also need to add a small
> > > completion check.
> > >
> > > This touches PolarisMetaStoreManager, which has both
> > > JDBC (atomic and transactional) and NoSQL
> > > implementations. I wanted to check the direction before
> > > coding, in line with our interface-change guidance.
> > >
> > > Does keeping the entity reserved and gating its removal
> > > on cleanup completion sound right, or would you prefer
> > > a different approach, such as a dedicated purge task
> > > that handles the final entity removal?
> > >
> > > Thanks,
> > > Prithvi
> > >
> > > >
> > >
Re: [DISCUSS] opt-in table soft-delete
Posted by Alex Dutra via dev <de...@polaris.apache.org>.
Hi Prithvi, hi all,
Two points from the remote signing work that relate to this proposal.
1. Spark's DROP TABLE ... PURGE is a drop without purge.
Spark doesn't ask the catalog to purge:
- It loads the table and calls the catalog's drop with purge=false.
- It then deletes the table's files itself, through the table's FileIO.
With Spark, the catalog never sees a purge. On a catalog with
soft-delete enabled, a Spark DROP TABLE ... PURGE would:
- put the table on hold, with its name reserved, even though the user
asked for a purge;
- delete its files right away from the client.
The hold would then keep a table whose files are gone, which matters
once recovery is added. With vended credentials, Polaris can't see or
prevent those deletes. This might be worth documenting.
2. Soft-delete would help remote signing.
I'm reviving S3 remote signing. Polaris authorizes each sign request
against the table, so it does see those deletes. Today, after a drop,
the table and its grants are gone. My current approach records the
principal's DROP_TABLE_WITH_PURGE decision in the remote signing token
when the table is loaded. After the drop, it then allows only reads
and deletes within the table's locations.
In [5544], a soft-deleted table keeps its row, id and grants. So for
those tables Polaris could:
- authorize the deletes against the table itself when they happen,
instead of relying on a decision recorded at load time;
- choose a policy for the hold: either allow the deletes, since the
client asked for a purge, or refuse them, so the table stays
recoverable. Only remote signing makes the second option possible.
Two questions:
- Which policy makes sense for deletes during the hold?
- The resolver hides dropped entities. Would an option to resolve a
soft-deleted table, for this purpose only, be acceptable?
Neither point should block Phase 1. I just want to make sure the two
features fit together.
Thanks,
Alex
[5544]: https://github.com/apache/polaris/pull/5544
On Thu, Nov 12, 2026 at 12:44 AM Dmitri Bourlatchkov via dev
<de...@polaris.apache.org> wrote:
>
> Hi Prithvi and all,
>
> I did another review round in GH.
>
> Re-posting here the key comment: I'm very hesitant about
> expiring soft-deleted entities during REST requests against other entities.
> I think the resulting behaviours are too "magical" from the end user's
> perspective.
>
> I believe the expiry use case belongs more naturally in the Admin Tool
> given the current codebase. Eventually it could also be handled by the
> delegation service [3990].
>
> WDYT?
>
> Thanks,
> Dmitri.
> [3990] https://github.com/apache/polaris/pull/3990
>
> On Mon, Oct 26, 2026 at 4:34 PM Prithvi S <pr...@gmail.com>
> wrote:
>
> > Hi all,
> >
> > Quick follow-up on the cleanup gating for Phase 1:
> > holding the identifier until the entity cleanup and its
> > child tasks finish, then releasing it.
> >
> > While implementing this, I found that the coupling is
> > in the metastore manager. dropEntityIfExists removes
> > the entity (freeing the name) and schedules the cleanup
> > task in the same transaction, by design.
> >
> > To keep the name reserved until cleanup completes, I'd
> > need to separate these operations: keep the dropped
> > entity, schedule cleanup, and remove the entity only
> > after the cleanup task and its child tasks have finished.
> >
> > We don't currently have a way to detect when a task
> > tree has completed. Tasks are fire-and-forget and
> > self-remove on success, so I'd also need to add a small
> > completion check.
> >
> > This touches PolarisMetaStoreManager, which has both
> > JDBC (atomic and transactional) and NoSQL
> > implementations. I wanted to check the direction before
> > coding, in line with our interface-change guidance.
> >
> > Does keeping the entity reserved and gating its removal
> > on cleanup completion sound right, or would you prefer
> > a different approach, such as a dedicated purge task
> > that handles the final entity removal?
> >
> > Thanks,
> > Prithvi
> >
> > >
> >
Re: [DISCUSS] opt-in table soft-delete
Posted by Dmitri Bourlatchkov via dev <de...@polaris.apache.org>.
Hi Prithvi and all,
I did another review round in GH.
Re-posting here the key comment: I'm very hesitant about
expiring soft-deleted entities during REST requests against other entities.
I think the resulting behaviours are too "magical" from the end user's
perspective.
I believe the expiry use case belongs more naturally in the Admin Tool
given the current codebase. Eventually it could also be handled by the
delegation service [3990].
WDYT?
Thanks,
Dmitri.
[3990] https://github.com/apache/polaris/pull/3990
On Mon, Oct 26, 2026 at 4:34 PM Prithvi S <pr...@gmail.com>
wrote:
> Hi all,
>
> Quick follow-up on the cleanup gating for Phase 1:
> holding the identifier until the entity cleanup and its
> child tasks finish, then releasing it.
>
> While implementing this, I found that the coupling is
> in the metastore manager. dropEntityIfExists removes
> the entity (freeing the name) and schedules the cleanup
> task in the same transaction, by design.
>
> To keep the name reserved until cleanup completes, I'd
> need to separate these operations: keep the dropped
> entity, schedule cleanup, and remove the entity only
> after the cleanup task and its child tasks have finished.
>
> We don't currently have a way to detect when a task
> tree has completed. Tasks are fire-and-forget and
> self-remove on success, so I'd also need to add a small
> completion check.
>
> This touches PolarisMetaStoreManager, which has both
> JDBC (atomic and transactional) and NoSQL
> implementations. I wanted to check the direction before
> coding, in line with our interface-change guidance.
>
> Does keeping the entity reserved and gating its removal
> on cleanup completion sound right, or would you prefer
> a different approach, such as a dedicated purge task
> that handles the final entity removal?
>
> Thanks,
> Prithvi
>
> >
>
Re: [DISCUSS] opt-in table soft-delete
Posted by Prithvi S <pr...@gmail.com>.
Hi all,
Quick follow-up on the cleanup gating for Phase 1:
holding the identifier until the entity cleanup and its
child tasks finish, then releasing it.
While implementing this, I found that the coupling is
in the metastore manager. dropEntityIfExists removes
the entity (freeing the name) and schedules the cleanup
task in the same transaction, by design.
To keep the name reserved until cleanup completes, I'd
need to separate these operations: keep the dropped
entity, schedule cleanup, and remove the entity only
after the cleanup task and its child tasks have finished.
We don't currently have a way to detect when a task
tree has completed. Tasks are fire-and-forget and
self-remove on success, so I'd also need to add a small
completion check.
This touches PolarisMetaStoreManager, which has both
JDBC (atomic and transactional) and NoSQL
implementations. I wanted to check the direction before
coding, in line with our interface-change guidance.
Does keeping the entity reserved and gating its removal
on cleanup completion sound right, or would you prefer
a different approach, such as a dedicated purge task
that handles the final entity removal?
Thanks,
Prithvi
>
Re: [DISCUSS] opt-in table soft-delete
Posted by Prithvi S <pr...@gmail.com>.
Hi Dmitri, JB, Yufei,
Thanks, everyone.
Dmitri, agreed. For Phase 1, we'll make sure the data is
fully cleaned up before a soft-deleted identifier can be
reused.
In PR #5544 <https://github.com/apache/polaris/pull/5544>, When a
soft-deleted table is permanently deleted, its
identifier will remain reserved until the entity cleanup
and all child tasks it spawns have completed. Only then
will the name be released, so another entity can't reuse
it while the old data files are still there.
One thing from the PR review is worth calling out:
currently, the identifier is released before the async
cleanup finishes. Just scheduling cleanup isn't enough.
I'll make the release wait for cleanup to finish and add
a test that pauses cleanup, verifies recreation is
blocked while cleanup is in progress, and confirms it
succeeds only after cleanup completes.
This also means cleanup can't be skipped when releasing
a name for reuse. Legal-hold catalogs won't be affected,
since they never release the identifier.
Yufei, for the compliance/legal-hold use case, the main
requirement is a recoverable DROP with a retention
period. The table's catalog state and metadata are
retained during that period, the table is hidden from the
Iceberg REST API, and its identifier remains reserved.
This supports legal hold, where the table and its data
must remain preserved during the retention window, as
well as Nessie-to-Polaris migration, where a dropped but
retained table may need to be recovered.
The key point is that another table can't reuse the name
until the retained data has actually been purged. The
cleanup gating above ensures that.
Let me know if this matches what you had in mind, and
I'll update the PR accordingly.
Thanks,
Prithvi
Re: [DISCUSS] opt-in table soft-delete
Posted by Dmitri Bourlatchkov <di...@apache.org>.
Hi All,
Re: Default location reuse with soft delete
I do believe we cannot reuse the name-based location because it will open
data confidentiality attack vectors.
Therefore, we must purge the data before allowing the soft-deleted name to
be reused by a different entity.
I'll try to make another PR review round soon, but I cannot promise any ETL
:)
Cheers,
Dmitri.
On Sat, Sep 19, 2026 at 4:43 AM Prithvi S <pr...@gmail.com>
wrote:
> Hi JB, Dmitri,
>
> Thanks for the replies, and thanks Dmitri for looking at the draft PR.
>
> JB, on eviction: Phase 1 is lazy on namespace access, not a scheduled
> sweep.
> When TABLE_SOFT_DELETE_ENABLED is false (the default), expiration is a
> no-op: a catalog config check only. Catalogs that keep hard DROP do not
> scan held tables.
> When it is enabled, the next list, create, or drop-namespace in that
> namespace lists Iceberg tables under it (live and dropped) and permanently
> deletes those whose toPurgeTimestamp has passed. Catalog state is always
> removed then. File cleanup is a separate flag and uses the existing
> ENTITY_CLEANUP_SCHEDULER. There is no dedicated expiration task, and no
> purge-now API, in Phase 1 :)
> So the cost you asked about only applies to catalogs that opt in. A
> namespace with many held tables then pays a full Iceberg-table listing on
> those operations. I documented that on TABLE_SOFT_DELETE_HOLD_PERIOD in the
> draft PR. A scheduled sweep can wait until we know whether lazy-on-access
> is enough.
>
> Dmitri also noted on the PR that leaving files in place after expire, then
> freeing the name, can let a recreated table see leftover data until unique
> locations are enforced. The DISCUSS default was file cleanup off so expire
> matches DROP without purge. If Phase 1 should always enqueue entity-cleanup
> when a soft-deleted table is permanently deleted, I can change the draft.
>
> Thanks,
> Prithvi S
>
> On Sat, Sep 19, 2026 at 5:54 AM Dmitri Bourlatchkov <di...@apache.org>
> wrote:
>
> > Hi Prithvi,
> >
> > The proposed two phase approach sounds reasonable to me. I'll try and
> > review the PR ASAP.
> >
> > Cheers,
> > Dmitri.
> >
> > On Thu, Sep 17, 2026 at 10:25 PM Prithvi S <pr...@gmail.com>
> > wrote:
> >
> > > Hi all,
> > >
> > > I'd like to start a discussion on opt-in table soft-delete, hold
> period,
> > > and later undrop: https://github.com/apache/polaris/issues/5054
> > >
> > > Polaris DROP is hard from the catalog's point of view: the active name
> > > disappears, and there is no hold period or undrop. Operators who need a
> > > recoverable drop (compliance / legal hold, Nessie-to-Polaris migration)
> > > invent workarounds that Iceberg REST clients can bypass.
> > >
> > > The change is opt-in and default-off, so catalogs that want today's
> hard
> > > DROP keep it.
> > >
> > > Thanks to Dmitri for looking at this earlier. His suggestion was that
> > name
> > > reuse after soft-delete should be blocked until tables have unique
> > > locations (PR #4606), because shared locations plus a recreated table
> > > interact badly with staged-create credential refresh.
> > >
> > > #4606 has merged, but unique locations are still off by default,
> existing
> > > tables are unchanged, and client-specified locations are still allowed.
> > So
> > > "all tables have unique locations" is not true today, and I do not want
> > > #5054 to wait on that migration.
> > >
> > > The original GitHub issue freed the table name as soon as the table was
> > > soft-deleted, so a drop-and-recreate ETL job could create the same
> > > identifier again during the hold. I now think that is the wrong default
> > for
> > > an opt-in hold/recover feature:
> > > * A legal-hold table should not share its identifier with a new live
> > > table.
> > > * Undrop is unambiguous if the name is still reserved.
> > > * Drop-and-recreate ETL is unchanged on catalogs that leave the
> feature
> > > off (the default). Catalogs that enable it can DROP PURGE when they
> truly
> > > want the name back immediately.
> > >
> > > Phase 1 (default off): Catalog-scoped, INTERNAL Iceberg tables only.
> > > Disabled catalogs keep
> > > today's DROP behavior.
> > > * DROP without purge -> soft-delete: entity retained, metadata
> location
> > > retained, data/metadata files not deleted.
> > > * Soft-deleted tables are not listable or loadable on normal Iceberg
> > REST
> > > paths.
> > > * The identifier stays reserved for the hold period (default 7 days).
> > > CREATE / register with the same name fails until permanent delete or a
> > > later undrop.
> > > * DROP PURGE on a live table remains immediate permanent delete,
> using
> > > the existing cleanup path.
> > > * After the hold, the next list/create/drop-namespace in that
> namespace
> > > permanently deletes catalog state. File cleanup is opt-in (default off)
> > and
> > > uses today's ENTITY_CLEANUP_SCHEDULER.
> > > * No new Iceberg REST undrop. No change to unique-location defaults.
> > > * No new privileges in Phase 1: soft-drop uses TABLE_DROP; purge
> keeps
> > > the current drop-with-purge authorization.
> > >
> > > Persistence: in-place dropped entity with dropTimestamp /
> > toPurgeTimestamp,
> > > filtered out of the active resolve/list path. Do not revive the old
> > > entitiesDropped SPI.
> > >
> > > Phase 2: List soft-deleted tables and undrop, with new privileges. Name
> > > reuse after soft-delete only if/when a catalog actually has unique
> > > locations for every table.
> > >
> > > out of scope for this thread:
> > > * Staged-create credential refresh
> > > * Flipping DEFAULT_UNIQUE_TABLE_LOCATION_ENABLED default
> > >
> > > questions:
> > > 1. Is reserving the identifier during the hold acceptable for Phase
> 1,
> > > instead of freeing the table name on soft-delete?
> > > 2. Is it correct that DROP PURGE stays "destroy now", and only DROP
> > > without purge enters the hold?
> > >
> > > I opened a draft PR for Phase 1:
> > > https://github.com/apache/polaris/pull/5544
> > >
> > > Thanks,
> > > Prithvi S
> > >
> >
>
Re: [DISCUSS] opt-in table soft-delete
Posted by Prithvi S <pr...@gmail.com>.
Hi JB, Dmitri,
Thanks for the replies, and thanks Dmitri for looking at the draft PR.
JB, on eviction: Phase 1 is lazy on namespace access, not a scheduled sweep.
When TABLE_SOFT_DELETE_ENABLED is false (the default), expiration is a
no-op: a catalog config check only. Catalogs that keep hard DROP do not
scan held tables.
When it is enabled, the next list, create, or drop-namespace in that
namespace lists Iceberg tables under it (live and dropped) and permanently
deletes those whose toPurgeTimestamp has passed. Catalog state is always
removed then. File cleanup is a separate flag and uses the existing
ENTITY_CLEANUP_SCHEDULER. There is no dedicated expiration task, and no
purge-now API, in Phase 1 :)
So the cost you asked about only applies to catalogs that opt in. A
namespace with many held tables then pays a full Iceberg-table listing on
those operations. I documented that on TABLE_SOFT_DELETE_HOLD_PERIOD in the
draft PR. A scheduled sweep can wait until we know whether lazy-on-access
is enough.
Dmitri also noted on the PR that leaving files in place after expire, then
freeing the name, can let a recreated table see leftover data until unique
locations are enforced. The DISCUSS default was file cleanup off so expire
matches DROP without purge. If Phase 1 should always enqueue entity-cleanup
when a soft-deleted table is permanently deleted, I can change the draft.
Thanks,
Prithvi S
On Sat, Sep 19, 2026 at 5:54 AM Dmitri Bourlatchkov <di...@apache.org>
wrote:
> Hi Prithvi,
>
> The proposed two phase approach sounds reasonable to me. I'll try and
> review the PR ASAP.
>
> Cheers,
> Dmitri.
>
> On Thu, Sep 17, 2026 at 10:25 PM Prithvi S <pr...@gmail.com>
> wrote:
>
> > Hi all,
> >
> > I'd like to start a discussion on opt-in table soft-delete, hold period,
> > and later undrop: https://github.com/apache/polaris/issues/5054
> >
> > Polaris DROP is hard from the catalog's point of view: the active name
> > disappears, and there is no hold period or undrop. Operators who need a
> > recoverable drop (compliance / legal hold, Nessie-to-Polaris migration)
> > invent workarounds that Iceberg REST clients can bypass.
> >
> > The change is opt-in and default-off, so catalogs that want today's hard
> > DROP keep it.
> >
> > Thanks to Dmitri for looking at this earlier. His suggestion was that
> name
> > reuse after soft-delete should be blocked until tables have unique
> > locations (PR #4606), because shared locations plus a recreated table
> > interact badly with staged-create credential refresh.
> >
> > #4606 has merged, but unique locations are still off by default, existing
> > tables are unchanged, and client-specified locations are still allowed.
> So
> > "all tables have unique locations" is not true today, and I do not want
> > #5054 to wait on that migration.
> >
> > The original GitHub issue freed the table name as soon as the table was
> > soft-deleted, so a drop-and-recreate ETL job could create the same
> > identifier again during the hold. I now think that is the wrong default
> for
> > an opt-in hold/recover feature:
> > * A legal-hold table should not share its identifier with a new live
> > table.
> > * Undrop is unambiguous if the name is still reserved.
> > * Drop-and-recreate ETL is unchanged on catalogs that leave the feature
> > off (the default). Catalogs that enable it can DROP PURGE when they truly
> > want the name back immediately.
> >
> > Phase 1 (default off): Catalog-scoped, INTERNAL Iceberg tables only.
> > Disabled catalogs keep
> > today's DROP behavior.
> > * DROP without purge -> soft-delete: entity retained, metadata location
> > retained, data/metadata files not deleted.
> > * Soft-deleted tables are not listable or loadable on normal Iceberg
> REST
> > paths.
> > * The identifier stays reserved for the hold period (default 7 days).
> > CREATE / register with the same name fails until permanent delete or a
> > later undrop.
> > * DROP PURGE on a live table remains immediate permanent delete, using
> > the existing cleanup path.
> > * After the hold, the next list/create/drop-namespace in that namespace
> > permanently deletes catalog state. File cleanup is opt-in (default off)
> and
> > uses today's ENTITY_CLEANUP_SCHEDULER.
> > * No new Iceberg REST undrop. No change to unique-location defaults.
> > * No new privileges in Phase 1: soft-drop uses TABLE_DROP; purge keeps
> > the current drop-with-purge authorization.
> >
> > Persistence: in-place dropped entity with dropTimestamp /
> toPurgeTimestamp,
> > filtered out of the active resolve/list path. Do not revive the old
> > entitiesDropped SPI.
> >
> > Phase 2: List soft-deleted tables and undrop, with new privileges. Name
> > reuse after soft-delete only if/when a catalog actually has unique
> > locations for every table.
> >
> > out of scope for this thread:
> > * Staged-create credential refresh
> > * Flipping DEFAULT_UNIQUE_TABLE_LOCATION_ENABLED default
> >
> > questions:
> > 1. Is reserving the identifier during the hold acceptable for Phase 1,
> > instead of freeing the table name on soft-delete?
> > 2. Is it correct that DROP PURGE stays "destroy now", and only DROP
> > without purge enters the hold?
> >
> > I opened a draft PR for Phase 1:
> > https://github.com/apache/polaris/pull/5544
> >
> > Thanks,
> > Prithvi S
> >
>
Re: [DISCUSS] opt-in table soft-delete
Posted by Dmitri Bourlatchkov <di...@apache.org>.
Hi Prithvi,
The proposed two phase approach sounds reasonable to me. I'll try and
review the PR ASAP.
Cheers,
Dmitri.
On Thu, Sep 17, 2026 at 10:25 PM Prithvi S <pr...@gmail.com>
wrote:
> Hi all,
>
> I'd like to start a discussion on opt-in table soft-delete, hold period,
> and later undrop: https://github.com/apache/polaris/issues/5054
>
> Polaris DROP is hard from the catalog's point of view: the active name
> disappears, and there is no hold period or undrop. Operators who need a
> recoverable drop (compliance / legal hold, Nessie-to-Polaris migration)
> invent workarounds that Iceberg REST clients can bypass.
>
> The change is opt-in and default-off, so catalogs that want today's hard
> DROP keep it.
>
> Thanks to Dmitri for looking at this earlier. His suggestion was that name
> reuse after soft-delete should be blocked until tables have unique
> locations (PR #4606), because shared locations plus a recreated table
> interact badly with staged-create credential refresh.
>
> #4606 has merged, but unique locations are still off by default, existing
> tables are unchanged, and client-specified locations are still allowed. So
> "all tables have unique locations" is not true today, and I do not want
> #5054 to wait on that migration.
>
> The original GitHub issue freed the table name as soon as the table was
> soft-deleted, so a drop-and-recreate ETL job could create the same
> identifier again during the hold. I now think that is the wrong default for
> an opt-in hold/recover feature:
> * A legal-hold table should not share its identifier with a new live
> table.
> * Undrop is unambiguous if the name is still reserved.
> * Drop-and-recreate ETL is unchanged on catalogs that leave the feature
> off (the default). Catalogs that enable it can DROP PURGE when they truly
> want the name back immediately.
>
> Phase 1 (default off): Catalog-scoped, INTERNAL Iceberg tables only.
> Disabled catalogs keep
> today's DROP behavior.
> * DROP without purge -> soft-delete: entity retained, metadata location
> retained, data/metadata files not deleted.
> * Soft-deleted tables are not listable or loadable on normal Iceberg REST
> paths.
> * The identifier stays reserved for the hold period (default 7 days).
> CREATE / register with the same name fails until permanent delete or a
> later undrop.
> * DROP PURGE on a live table remains immediate permanent delete, using
> the existing cleanup path.
> * After the hold, the next list/create/drop-namespace in that namespace
> permanently deletes catalog state. File cleanup is opt-in (default off) and
> uses today's ENTITY_CLEANUP_SCHEDULER.
> * No new Iceberg REST undrop. No change to unique-location defaults.
> * No new privileges in Phase 1: soft-drop uses TABLE_DROP; purge keeps
> the current drop-with-purge authorization.
>
> Persistence: in-place dropped entity with dropTimestamp / toPurgeTimestamp,
> filtered out of the active resolve/list path. Do not revive the old
> entitiesDropped SPI.
>
> Phase 2: List soft-deleted tables and undrop, with new privileges. Name
> reuse after soft-delete only if/when a catalog actually has unique
> locations for every table.
>
> out of scope for this thread:
> * Staged-create credential refresh
> * Flipping DEFAULT_UNIQUE_TABLE_LOCATION_ENABLED default
>
> questions:
> 1. Is reserving the identifier during the hold acceptable for Phase 1,
> instead of freeing the table name on soft-delete?
> 2. Is it correct that DROP PURGE stays "destroy now", and only DROP
> without purge enters the hold?
>
> I opened a draft PR for Phase 1:
> https://github.com/apache/polaris/pull/5544
>
> Thanks,
> Prithvi S
>
Re: [DISCUSS] opt-in table soft-delete
Posted by Yufei Gu <fl...@gmail.com>.
Pls ignore my previous email. Wrong thread.
Yufei
On Thu, Sep 17, 2026 at 9:37 PM Yufei Gu <fl...@gmail.com> wrote:
> Hi Vignesh,
>
> Thanks for reporting this. Based on an initial code review, the
> table-level endpoint redirection appears to be a valid issue.
>
> Please share your proposed fix privately on this thread when ready. A
> regression test covering the table-level permissions and server-side
> request destination would help confirm the behavior and validate the fix.
> We should also confirm the affected versions before finalizing severity and
> advisory handling.
> Yufei
>
>
> On Thu, Sep 17, 2026 at 9:28 PM Jean-Baptiste Onofré <jb...@nanthrax.net>
> wrote:
>
>> Hi Prithvi,
>>
>> Thanks for starting this discussion!
>>
>> I think it's a good call, and building on the existing
>> dropTimestamp/purgeTimestamp/isDropped() fields instead of reviving
>> entitiesDropped is a low risk in a first phase.
>>
>> Regarding your two questions:
>> 1. Reserving the identifier during the hold: yes, I agree, this is the
>> safer by default. It does mean drop-and-recreate ETL changes behavior on
>> catalogs that opt in, but I believe it's reasonable cost given the feature
>> is opt in and DROP PURGE is still available (as an explicit "give me the
>> name back now"). Freeing the name immediately would reopen the
>> shared-location/staged-create-credential-refresh race that we changed.
>> Since unique locations are not default on yet, that invariant doesn't hold
>> today. Gating name reusing on a second phase (once unique locations are
>> actually universal) rather than blocking the whole feature on that
>> "migration" seems right.
>> 2. DROP PURGE staying "destroy now" with only plain DROP entering the
>> hold:
>> I also agree, that's a clean two-tier model (recoverable vs destructive)
>> and matches how DROP_WITH_PURGE_ENABLED already behaves today.
>>
>> I just have one question: "the next list/create/drop-namespace in that
>> namespace permanently deletes catalog state", is that a scan over
>> soft-deleted entities in the namespace triggered on every list/create
>> call?
>> or something cheaper? If it's a scan, I would like to understand the cost
>> on namespace with a lot of held tables, even with the feature off by
>> default. I think it would be worth spelling out the eviction mechanism
>> (lazy on access vs a scheduled sweep).
>>
>> Thanks,
>> Regards
>> JB
>>
>> On Fri, Sep 18, 2026 at 4:25 AM Prithvi S <pr...@gmail.com>
>> wrote:
>>
>> > Hi all,
>> >
>> > I'd like to start a discussion on opt-in table soft-delete, hold period,
>> > and later undrop: https://github.com/apache/polaris/issues/5054
>> >
>> > Polaris DROP is hard from the catalog's point of view: the active name
>> > disappears, and there is no hold period or undrop. Operators who need a
>> > recoverable drop (compliance / legal hold, Nessie-to-Polaris migration)
>> > invent workarounds that Iceberg REST clients can bypass.
>> >
>> > The change is opt-in and default-off, so catalogs that want today's hard
>> > DROP keep it.
>> >
>> > Thanks to Dmitri for looking at this earlier. His suggestion was that
>> name
>> > reuse after soft-delete should be blocked until tables have unique
>> > locations (PR #4606), because shared locations plus a recreated table
>> > interact badly with staged-create credential refresh.
>> >
>> > #4606 has merged, but unique locations are still off by default,
>> existing
>> > tables are unchanged, and client-specified locations are still allowed.
>> So
>> > "all tables have unique locations" is not true today, and I do not want
>> > #5054 to wait on that migration.
>> >
>> > The original GitHub issue freed the table name as soon as the table was
>> > soft-deleted, so a drop-and-recreate ETL job could create the same
>> > identifier again during the hold. I now think that is the wrong default
>> for
>> > an opt-in hold/recover feature:
>> > * A legal-hold table should not share its identifier with a new live
>> > table.
>> > * Undrop is unambiguous if the name is still reserved.
>> > * Drop-and-recreate ETL is unchanged on catalogs that leave the
>> feature
>> > off (the default). Catalogs that enable it can DROP PURGE when they
>> truly
>> > want the name back immediately.
>> >
>> > Phase 1 (default off): Catalog-scoped, INTERNAL Iceberg tables only.
>> > Disabled catalogs keep
>> > today's DROP behavior.
>> > * DROP without purge -> soft-delete: entity retained, metadata
>> location
>> > retained, data/metadata files not deleted.
>> > * Soft-deleted tables are not listable or loadable on normal Iceberg
>> REST
>> > paths.
>> > * The identifier stays reserved for the hold period (default 7 days).
>> > CREATE / register with the same name fails until permanent delete or a
>> > later undrop.
>> > * DROP PURGE on a live table remains immediate permanent delete, using
>> > the existing cleanup path.
>> > * After the hold, the next list/create/drop-namespace in that
>> namespace
>> > permanently deletes catalog state. File cleanup is opt-in (default off)
>> and
>> > uses today's ENTITY_CLEANUP_SCHEDULER.
>> > * No new Iceberg REST undrop. No change to unique-location defaults.
>> > * No new privileges in Phase 1: soft-drop uses TABLE_DROP; purge keeps
>> > the current drop-with-purge authorization.
>> >
>> > Persistence: in-place dropped entity with dropTimestamp /
>> toPurgeTimestamp,
>> > filtered out of the active resolve/list path. Do not revive the old
>> > entitiesDropped SPI.
>> >
>> > Phase 2: List soft-deleted tables and undrop, with new privileges. Name
>> > reuse after soft-delete only if/when a catalog actually has unique
>> > locations for every table.
>> >
>> > out of scope for this thread:
>> > * Staged-create credential refresh
>> > * Flipping DEFAULT_UNIQUE_TABLE_LOCATION_ENABLED default
>> >
>> > questions:
>> > 1. Is reserving the identifier during the hold acceptable for Phase 1,
>> > instead of freeing the table name on soft-delete?
>> > 2. Is it correct that DROP PURGE stays "destroy now", and only DROP
>> > without purge enters the hold?
>> >
>> > I opened a draft PR for Phase 1:
>> > https://github.com/apache/polaris/pull/5544
>> >
>> > Thanks,
>> > Prithvi S
>> >
>>
>
Re: [DISCUSS] opt-in table soft-delete
Posted by Yufei Gu <fl...@gmail.com>.
Hi Vignesh,
Thanks for reporting this. Based on an initial code review, the table-level
endpoint redirection appears to be a valid issue.
Please share your proposed fix privately on this thread when ready. A
regression test covering the table-level permissions and server-side
request destination would help confirm the behavior and validate the fix.
We should also confirm the affected versions before finalizing severity and
advisory handling.
Yufei
On Thu, Sep 17, 2026 at 9:28 PM Jean-Baptiste Onofré <jb...@nanthrax.net>
wrote:
> Hi Prithvi,
>
> Thanks for starting this discussion!
>
> I think it's a good call, and building on the existing
> dropTimestamp/purgeTimestamp/isDropped() fields instead of reviving
> entitiesDropped is a low risk in a first phase.
>
> Regarding your two questions:
> 1. Reserving the identifier during the hold: yes, I agree, this is the
> safer by default. It does mean drop-and-recreate ETL changes behavior on
> catalogs that opt in, but I believe it's reasonable cost given the feature
> is opt in and DROP PURGE is still available (as an explicit "give me the
> name back now"). Freeing the name immediately would reopen the
> shared-location/staged-create-credential-refresh race that we changed.
> Since unique locations are not default on yet, that invariant doesn't hold
> today. Gating name reusing on a second phase (once unique locations are
> actually universal) rather than blocking the whole feature on that
> "migration" seems right.
> 2. DROP PURGE staying "destroy now" with only plain DROP entering the hold:
> I also agree, that's a clean two-tier model (recoverable vs destructive)
> and matches how DROP_WITH_PURGE_ENABLED already behaves today.
>
> I just have one question: "the next list/create/drop-namespace in that
> namespace permanently deletes catalog state", is that a scan over
> soft-deleted entities in the namespace triggered on every list/create call?
> or something cheaper? If it's a scan, I would like to understand the cost
> on namespace with a lot of held tables, even with the feature off by
> default. I think it would be worth spelling out the eviction mechanism
> (lazy on access vs a scheduled sweep).
>
> Thanks,
> Regards
> JB
>
> On Fri, Sep 18, 2026 at 4:25 AM Prithvi S <pr...@gmail.com>
> wrote:
>
> > Hi all,
> >
> > I'd like to start a discussion on opt-in table soft-delete, hold period,
> > and later undrop: https://github.com/apache/polaris/issues/5054
> >
> > Polaris DROP is hard from the catalog's point of view: the active name
> > disappears, and there is no hold period or undrop. Operators who need a
> > recoverable drop (compliance / legal hold, Nessie-to-Polaris migration)
> > invent workarounds that Iceberg REST clients can bypass.
> >
> > The change is opt-in and default-off, so catalogs that want today's hard
> > DROP keep it.
> >
> > Thanks to Dmitri for looking at this earlier. His suggestion was that
> name
> > reuse after soft-delete should be blocked until tables have unique
> > locations (PR #4606), because shared locations plus a recreated table
> > interact badly with staged-create credential refresh.
> >
> > #4606 has merged, but unique locations are still off by default, existing
> > tables are unchanged, and client-specified locations are still allowed.
> So
> > "all tables have unique locations" is not true today, and I do not want
> > #5054 to wait on that migration.
> >
> > The original GitHub issue freed the table name as soon as the table was
> > soft-deleted, so a drop-and-recreate ETL job could create the same
> > identifier again during the hold. I now think that is the wrong default
> for
> > an opt-in hold/recover feature:
> > * A legal-hold table should not share its identifier with a new live
> > table.
> > * Undrop is unambiguous if the name is still reserved.
> > * Drop-and-recreate ETL is unchanged on catalogs that leave the feature
> > off (the default). Catalogs that enable it can DROP PURGE when they truly
> > want the name back immediately.
> >
> > Phase 1 (default off): Catalog-scoped, INTERNAL Iceberg tables only.
> > Disabled catalogs keep
> > today's DROP behavior.
> > * DROP without purge -> soft-delete: entity retained, metadata location
> > retained, data/metadata files not deleted.
> > * Soft-deleted tables are not listable or loadable on normal Iceberg
> REST
> > paths.
> > * The identifier stays reserved for the hold period (default 7 days).
> > CREATE / register with the same name fails until permanent delete or a
> > later undrop.
> > * DROP PURGE on a live table remains immediate permanent delete, using
> > the existing cleanup path.
> > * After the hold, the next list/create/drop-namespace in that namespace
> > permanently deletes catalog state. File cleanup is opt-in (default off)
> and
> > uses today's ENTITY_CLEANUP_SCHEDULER.
> > * No new Iceberg REST undrop. No change to unique-location defaults.
> > * No new privileges in Phase 1: soft-drop uses TABLE_DROP; purge keeps
> > the current drop-with-purge authorization.
> >
> > Persistence: in-place dropped entity with dropTimestamp /
> toPurgeTimestamp,
> > filtered out of the active resolve/list path. Do not revive the old
> > entitiesDropped SPI.
> >
> > Phase 2: List soft-deleted tables and undrop, with new privileges. Name
> > reuse after soft-delete only if/when a catalog actually has unique
> > locations for every table.
> >
> > out of scope for this thread:
> > * Staged-create credential refresh
> > * Flipping DEFAULT_UNIQUE_TABLE_LOCATION_ENABLED default
> >
> > questions:
> > 1. Is reserving the identifier during the hold acceptable for Phase 1,
> > instead of freeing the table name on soft-delete?
> > 2. Is it correct that DROP PURGE stays "destroy now", and only DROP
> > without purge enters the hold?
> >
> > I opened a draft PR for Phase 1:
> > https://github.com/apache/polaris/pull/5544
> >
> > Thanks,
> > Prithvi S
> >
>
Re: [DISCUSS] opt-in table soft-delete
Posted by Jean-Baptiste Onofré <jb...@nanthrax.net>.
Hi Prithvi,
Thanks for starting this discussion!
I think it's a good call, and building on the existing
dropTimestamp/purgeTimestamp/isDropped() fields instead of reviving
entitiesDropped is a low risk in a first phase.
Regarding your two questions:
1. Reserving the identifier during the hold: yes, I agree, this is the
safer by default. It does mean drop-and-recreate ETL changes behavior on
catalogs that opt in, but I believe it's reasonable cost given the feature
is opt in and DROP PURGE is still available (as an explicit "give me the
name back now"). Freeing the name immediately would reopen the
shared-location/staged-create-credential-refresh race that we changed.
Since unique locations are not default on yet, that invariant doesn't hold
today. Gating name reusing on a second phase (once unique locations are
actually universal) rather than blocking the whole feature on that
"migration" seems right.
2. DROP PURGE staying "destroy now" with only plain DROP entering the hold:
I also agree, that's a clean two-tier model (recoverable vs destructive)
and matches how DROP_WITH_PURGE_ENABLED already behaves today.
I just have one question: "the next list/create/drop-namespace in that
namespace permanently deletes catalog state", is that a scan over
soft-deleted entities in the namespace triggered on every list/create call?
or something cheaper? If it's a scan, I would like to understand the cost
on namespace with a lot of held tables, even with the feature off by
default. I think it would be worth spelling out the eviction mechanism
(lazy on access vs a scheduled sweep).
Thanks,
Regards
JB
On Fri, Sep 18, 2026 at 4:25 AM Prithvi S <pr...@gmail.com>
wrote:
> Hi all,
>
> I'd like to start a discussion on opt-in table soft-delete, hold period,
> and later undrop: https://github.com/apache/polaris/issues/5054
>
> Polaris DROP is hard from the catalog's point of view: the active name
> disappears, and there is no hold period or undrop. Operators who need a
> recoverable drop (compliance / legal hold, Nessie-to-Polaris migration)
> invent workarounds that Iceberg REST clients can bypass.
>
> The change is opt-in and default-off, so catalogs that want today's hard
> DROP keep it.
>
> Thanks to Dmitri for looking at this earlier. His suggestion was that name
> reuse after soft-delete should be blocked until tables have unique
> locations (PR #4606), because shared locations plus a recreated table
> interact badly with staged-create credential refresh.
>
> #4606 has merged, but unique locations are still off by default, existing
> tables are unchanged, and client-specified locations are still allowed. So
> "all tables have unique locations" is not true today, and I do not want
> #5054 to wait on that migration.
>
> The original GitHub issue freed the table name as soon as the table was
> soft-deleted, so a drop-and-recreate ETL job could create the same
> identifier again during the hold. I now think that is the wrong default for
> an opt-in hold/recover feature:
> * A legal-hold table should not share its identifier with a new live
> table.
> * Undrop is unambiguous if the name is still reserved.
> * Drop-and-recreate ETL is unchanged on catalogs that leave the feature
> off (the default). Catalogs that enable it can DROP PURGE when they truly
> want the name back immediately.
>
> Phase 1 (default off): Catalog-scoped, INTERNAL Iceberg tables only.
> Disabled catalogs keep
> today's DROP behavior.
> * DROP without purge -> soft-delete: entity retained, metadata location
> retained, data/metadata files not deleted.
> * Soft-deleted tables are not listable or loadable on normal Iceberg REST
> paths.
> * The identifier stays reserved for the hold period (default 7 days).
> CREATE / register with the same name fails until permanent delete or a
> later undrop.
> * DROP PURGE on a live table remains immediate permanent delete, using
> the existing cleanup path.
> * After the hold, the next list/create/drop-namespace in that namespace
> permanently deletes catalog state. File cleanup is opt-in (default off) and
> uses today's ENTITY_CLEANUP_SCHEDULER.
> * No new Iceberg REST undrop. No change to unique-location defaults.
> * No new privileges in Phase 1: soft-drop uses TABLE_DROP; purge keeps
> the current drop-with-purge authorization.
>
> Persistence: in-place dropped entity with dropTimestamp / toPurgeTimestamp,
> filtered out of the active resolve/list path. Do not revive the old
> entitiesDropped SPI.
>
> Phase 2: List soft-deleted tables and undrop, with new privileges. Name
> reuse after soft-delete only if/when a catalog actually has unique
> locations for every table.
>
> out of scope for this thread:
> * Staged-create credential refresh
> * Flipping DEFAULT_UNIQUE_TABLE_LOCATION_ENABLED default
>
> questions:
> 1. Is reserving the identifier during the hold acceptable for Phase 1,
> instead of freeing the table name on soft-delete?
> 2. Is it correct that DROP PURGE stays "destroy now", and only DROP
> without purge enters the hold?
>
> I opened a draft PR for Phase 1:
> https://github.com/apache/polaris/pull/5544
>
> Thanks,
> Prithvi S
>