You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "Gurnek (via GitHub)" <gi...@apache.org> on 2026/02/19 14:15:12 UTC

[I] Snapshot rollback doesn't work [iceberg-python]

Gurnek opened a new issue, #3068:
URL: https://github.com/apache/iceberg-python/issues/3068

   ### Apache Iceberg version
   
   None
   
   ### Please describe the bug 🐞
   
   Hello, I have encountered an issue with the rollback functionality. I have my data in a Glue catalog, and I am running the following code in some form:
   ```
   tbl = catalog.load_table('db.table')
   print(tbl.metdata.current_snapshot_id)
   tbl.manage_snapshots().rollback_to_snapshot(123).commit() # 123 in this case would be a snapshot id that I know is an ancestor
   print(tbl.metadata.current_snapshot_id) # will print the same thing as before
   ```
   
   The table will still read from the same snapshot, however if I try to call `rollback_to_snapshot(123)` again, it will give the error `snapshot 123 is not an ancestor of current state: 123`. 
   
   Any help would be appreciated
   
   ### Willingness to contribute
   
   - [ ] I can contribute a fix for this bug independently
   - [ ] I would be willing to contribute a fix for this bug with guidance from the Iceberg community
   - [x] I cannot contribute a fix for this bug at this time


-- 
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: issues-unsubscribe@iceberg.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Snapshot rollback doesn't work [iceberg-python]

Posted by "geruh (via GitHub)" <gi...@apache.org>.
geruh commented on issue #3068:
URL: https://github.com/apache/iceberg-python/issues/3068#issuecomment-3929429155

   Hey @Gurnek, thanks for raising. 
   
   I tested this against my glue catalog with the 0.11.0 release and haven't been able to reproduce. Could you share some more information to help repo because maybe I'm missing something.
   
   For context I'm running this:
   
   ```python
   catalog = GlueCatalog('glue', **{'warehouse': 's3://<bucket>/warehouse/'})
   
   schema = Schema(
       NestedField(1, 'id', IntegerType(), required=False),
       NestedField(2, 'data', StringType()),
   )
   
   catalog.create_namespace_if_not_exists("db")
   
   tbl = catalog.create_table('db.test_tbl', schema=schema)
   
   for i in range(3):
       tbl.append(pa.table({'id': pa.array([i], type=pa.int32()), 'name': [f'data-{i}']}))
   
   snapshots = tbl.snapshots()
   target = snapshots[0].snapshot_id # <-- old snapshot
   
   print(f'Before: {tbl.metadata.current_snapshot_id}')
   
   tbl.manage_snapshots().rollback_to_snapshot(target).commit()
   
   print(f'After:  {tbl.metadata.current_snapshot_id}')
   
   ```
   
   Which then prints:
   
   ```bash
   Before: 6672913416757656702
   After:  2295944502128096469
   ```


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Snapshot rollback doesn't work [iceberg-python]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #3068:
URL: https://github.com/apache/iceberg-python/issues/3068#issuecomment-5335849808

   This issue has been automatically marked as stale because it has been open for 180 days with no activity. It will be closed in next 14 days if no further activity occurs. To permanently prevent this issue from being considered stale, add the label 'not-stale', but commenting on the issue is preferred when possible.


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Snapshot rollback doesn't work [iceberg-python]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] closed issue #3068: Snapshot rollback doesn't work
URL: https://github.com/apache/iceberg-python/issues/3068


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Snapshot rollback doesn't work [iceberg-python]

Posted by "Gurnek (via GitHub)" <gi...@apache.org>.
Gurnek commented on issue #3068:
URL: https://github.com/apache/iceberg-python/issues/3068#issuecomment-3929752402

   Ok, I was investigate the specific error I was getting as well, about the ancestor, and looking at my snapshot list for the table, all of my snapshots have a `parent_snapshot_id` of `None` which means they will fail the ancestor lookup. I'm not sure why all of the parents are gone or why I was able to call the rollback function once initially but I'm not convinced its a bug with the library anymore. Thank you


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org


Re: [I] Snapshot rollback doesn't work [iceberg-python]

Posted by "github-actions[bot] (via GitHub)" <gi...@apache.org>.
github-actions[bot] commented on issue #3068:
URL: https://github.com/apache/iceberg-python/issues/3068#issuecomment-5502509686

   This issue has been closed because it has not received any activity in the last 14 days since being marked as 'stale'


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org