yguy-ryft commented on code in PR #13432:
URL: https://github.com/apache/iceberg/pull/13432#discussion_r2228731547
##########
docs/docs/maintenance.md:
##########
@@ -63,20 +63,16 @@ Expiring old snapshots removes them from metadata, so they
are no longer availab
### Remove old metadata files
-Iceberg keeps track of table metadata using JSON files. Each change to a table
produces a new metadata file to provide atomicity.
+Iceberg keeps track of table metadata using JSON files. Each change to a table
produces a new metadata file to provide atomicity. Old metadata files are kept
for history by default, and are tracked in the `metadata-log` field of the
metadata file. Tables with frequent commits, like those written by streaming
jobs, may need to regularly clean metadata files to reduce metadata overhead.
-Old metadata files are kept for history by default. Tables with frequent
commits, like those written by streaming jobs, may need to regularly clean
metadata files.
+The number of metadata files being **tracked** is defined by
`write.metadata.previous-versions-max` (default is 100).
-To automatically clean metadata files, set
`write.metadata.delete-after-commit.enabled=true` in table properties. This
will keep some metadata files (up to `write.metadata.previous-versions-max`)
and will delete the oldest metadata file after each new one is created.
+To automatically delete older metadata files when they become untracked, set
`write.metadata.delete-after-commit.enabled=true` in table properties. This
will keep some metadata files as tracked (up to
`write.metadata.previous-versions-max`), and will delete the oldest metadata
file every time a new one is created.
+Alternatively, untracked metadata files can be deleted as part of [orphan file
deletion](#delete-orphan-files).
-| Property | Description
|
-| --------------------------------------------
|--------------------------------------------------------------------------|
-| `write.metadata.delete-after-commit.enabled` | Whether to delete old
**tracked** metadata files after each table commit |
-| `write.metadata.previous-versions-max` | The number of old metadata
files to keep |
-
-Note that this will only delete metadata files that are **tracked** in the
metadata log and will not delete orphaned metadata files.
-Example: With `write.metadata.delete-after-commit.enabled=false` and
`write.metadata.previous-versions-max=10`, one will have 10 tracked metadata
files and 90 orphaned metadata files after 100 commits.
-Configuring `write.metadata.delete-after-commit.enabled=true` and
`write.metadata.previous-versions-max=20` will not automatically delete
metadata files. Tracked metadata files would be deleted again when reaching
`write.metadata.previous-versions-max=20`.
Review Comment:
@gaborkaszab this was just rephrased, so it'll be clear that there are two
bullets with two examples. Is there any information missing there in your
opinion?
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]