Improve file-gc task

make it more aware of fragments referenced on changes snapshots
This commit is contained in:
Andrey Antukh 2023-04-25 17:14:38 +02:00
parent 82dad3217b
commit 5e89aa2726
7 changed files with 260 additions and 130 deletions

View file

@ -44,7 +44,8 @@
"storage/pointer-map"
"components/v2"})
(def default-features
(defn get-default-features
[]
(cond-> #{}
(contains? cf/flags :fdata-storage-pointer-map)
(conj "storage/pointer-map")
@ -234,6 +235,15 @@
(update-fn val)
val)))))))
(defn get-all-pointer-ids
"Given a file, return all pointer ids used in the data."
[fdata]
(->> (concat (vals fdata)
(vals (:pages-index fdata)))
(into #{} (comp (filter pmap/pointer-map?)
(map pmap/get-id)))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; QUERY COMMANDS
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;