1
0
mirror of https://github.com/haiwen/seafile-server.git synced 2025-04-28 03:20:10 +00:00

Don't retain when traverse base commit

This commit is contained in:
杨赫然 2025-01-10 17:21:14 +08:00
parent bc697b0b26
commit 91007791cd
2 changed files with 10 additions and 0 deletions

View File

@ -235,6 +235,7 @@ func GetEx(id string) *Repo {
}
if originRepoID.Valid {
repo.VirtualInfo = new(VRepoInfo)
repo.VirtualInfo.RepoID = id
repo.VirtualInfo.OriginRepoID = originRepoID.String
repo.StoreID = originRepoID.String

View File

@ -95,6 +95,8 @@ typedef struct {
SeafDBTrans *trans;
gint64 keep_alive_last_time;
gint64 keep_alive_obj_counter;
gboolean traverse_base_commit;
} GCData;
static int
@ -166,6 +168,12 @@ fs_callback (SeafFSManager *mgr,
add_fs_to_index(data, obj_id);
// If traversing the base_commit, only the fs objects need to be retained, while the block does not.
// This is because only the fs objects are needed when merging virtual repo.
if (data->repo->is_virtual && data->traverse_base_commit) {
return TRUE;
}
if (type == SEAF_METADATA_TYPE_FILE &&
add_blocks_to_index (mgr, data, obj_id) < 0)
return FALSE;
@ -422,6 +430,7 @@ populate_gc_index_for_repo (GCData *data, SeafDBTrans *trans)
if (!vinfo) {
continue;
}
data->traverse_base_commit = TRUE;
res = seaf_commit_manager_traverse_commit_tree (seaf->commit_mgr,
repo->store_id, repo->version,
vinfo->base_commit,