You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by "snazy (via GitHub)" <gi...@apache.org> on 2023/09/13 15:53:16 UTC

[GitHub] [iceberg] snazy commented on a diff in pull request #8382: Nessie: Permit Iceberg GC via explicit property overrides

snazy commented on code in PR #8382:
URL: https://github.com/apache/iceberg/pull/8382#discussion_r1324733369


##########
nessie/src/main/java/org/apache/iceberg/nessie/NessieUtil.java:
##########
@@ -102,6 +102,38 @@ private static String commitAuthor(Map<String, String> catalogOptions) {
         .orElseGet(() -> System.getProperty("user.name"));
   }
 
+  private static void checkAndUpdateGCProperties(
+      TableMetadata tableMetadata, Map<String, String> updatedProperties, String identifier) {
+    if (tableMetadata.propertyAsBoolean(
+        NessieTableOperations.NESSIE_GC_NO_WARNING_PROPERTY, false)) {
+      return;
+    }
+
+    // To prevent accidental deletion of files that are still referenced by other branches/tags,
+    // setting GC_ENABLED to 'false' is recommended, so that all Iceberg's gc operations like
+    // expire_snapshots, remove_orphan_files, drop_table with purge will fail with an error.
+    // `nessie-gc` CLI provides a reference-aware GC functionality for the expired/unreferenced
+    // files.
+    // Advanced users may still want to use the simpler Iceberg GC tools iff their Nessie Server
+    // contains only one branch (in which case the full Nessie history will be reflected in the
+    // Iceberg sequence of snapshots).
+    if (tableMetadata.propertyAsBoolean(
+            TableProperties.GC_ENABLED, TableProperties.GC_ENABLED_DEFAULT)

Review Comment:
   `tableMetadata.propertyAsBoolean()` would return `false` here, if the table-default setting is false, correct?



-- 
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