Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions common/storage-backend-multi.c
Original file line number Diff line number Diff line change
Expand Up @@ -634,6 +634,21 @@ prepare_auto_gc (MultiPriv *priv, const char *repo_id)
int ret;
if (!priv->auto_root)
return 0;
/* Cold GC must reopen the recorded physical backend, including historical
* custom keys. Resolve the immutable store itself, never a virtual origin.
* Older deletions may already have removed the route; retain their marker
* fallback until all pending GC work has been reconciled. */
storage_id = NULL;
ret = seaf_db_statement_foreach_row (priv->db,
"SELECT storage_id FROM RepoStorageId WHERE repo_id = ?",
read_storage_id, &storage_id, 1, "string", repo_id);
if (ret < 0)
return -1;
if (storage_id) {
backend = backend_for_id (priv, storage_id);
g_free (storage_id);
return backend ? 0 : -1;
}
ret = seaf_db_statement_foreach_row (priv->db,
"SELECT repo_key FROM cf_library_storage WHERE repo_id = ?",
read_storage_id, &key, 1, "string", repo_id);
Expand Down
8 changes: 8 additions & 0 deletions scripts/sql/mysql/cloudfile-v2-repo-feature.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
-- Store only explicitly enabled repository capabilities. Removing a row
-- disables that capability without changing storage routing or the other flag.
CREATE TABLE cf_repo_feature (
repo_id CHAR(36) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
feature VARCHAR(16) CHARACTER SET ascii COLLATE ascii_bin NOT NULL,
PRIMARY KEY (repo_id, feature),
CONSTRAINT repo_feature_name CHECK (feature IN ('checkout', 'protection'))
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;
Loading