mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-08-01 23:33:42 +00:00
Don't retain when traverse base commit
This commit is contained in:
parent
bc697b0b26
commit
91007791cd
@ -235,6 +235,7 @@ func GetEx(id string) *Repo {
|
|||||||
}
|
}
|
||||||
if originRepoID.Valid {
|
if originRepoID.Valid {
|
||||||
repo.VirtualInfo = new(VRepoInfo)
|
repo.VirtualInfo = new(VRepoInfo)
|
||||||
|
repo.VirtualInfo.RepoID = id
|
||||||
repo.VirtualInfo.OriginRepoID = originRepoID.String
|
repo.VirtualInfo.OriginRepoID = originRepoID.String
|
||||||
repo.StoreID = originRepoID.String
|
repo.StoreID = originRepoID.String
|
||||||
|
|
||||||
|
@ -95,6 +95,8 @@ typedef struct {
|
|||||||
SeafDBTrans *trans;
|
SeafDBTrans *trans;
|
||||||
gint64 keep_alive_last_time;
|
gint64 keep_alive_last_time;
|
||||||
gint64 keep_alive_obj_counter;
|
gint64 keep_alive_obj_counter;
|
||||||
|
|
||||||
|
gboolean traverse_base_commit;
|
||||||
} GCData;
|
} GCData;
|
||||||
|
|
||||||
static int
|
static int
|
||||||
@ -166,6 +168,12 @@ fs_callback (SeafFSManager *mgr,
|
|||||||
|
|
||||||
add_fs_to_index(data, obj_id);
|
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 &&
|
if (type == SEAF_METADATA_TYPE_FILE &&
|
||||||
add_blocks_to_index (mgr, data, obj_id) < 0)
|
add_blocks_to_index (mgr, data, obj_id) < 0)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
@ -422,6 +430,7 @@ populate_gc_index_for_repo (GCData *data, SeafDBTrans *trans)
|
|||||||
if (!vinfo) {
|
if (!vinfo) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
data->traverse_base_commit = TRUE;
|
||||||
res = seaf_commit_manager_traverse_commit_tree (seaf->commit_mgr,
|
res = seaf_commit_manager_traverse_commit_tree (seaf->commit_mgr,
|
||||||
repo->store_id, repo->version,
|
repo->store_id, repo->version,
|
||||||
vinfo->base_commit,
|
vinfo->base_commit,
|
||||||
|
Loading…
Reference in New Issue
Block a user