Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 分块上传优化 #2813 #2816

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open

Conversation

zzdjx
Copy link
Collaborator

@zzdjx zzdjx commented Dec 3, 2024

No description provided.

@zzdjx zzdjx requested review from owenlxu and removed request for cnlkl, felixncheng and yaoxuwan December 3, 2024 08:02
@zzdjx zzdjx added the for test label Dec 19, 2024
felixncheng
felixncheng previously approved these changes Dec 25, 2024
@cnlkl cnlkl self-requested a review January 6, 2025 11:42
/**
* 删除旧分块,即删除非指定的nodeCurrentSha256的分块。
* 如果未指定nodeCurrentSha256,则删除节点所有分块
* 如果指定uploadId,则删除该uploadId对应的分块,未指定则删除所有分块
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

未指定时指挥删除uploadId为null的分块,而不是所有分块

if (deletedNum == 0L) return NodeDeleteResult(0L, 0L, deleteTime)

// 计算删除的文件大小
val deletedSize = nodeBaseService.aggregateComputeSize(criteria.apply {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不需要计算删除的文件大小

@@ -137,7 +145,9 @@ class GenericLocalRepository(
private val replicaTaskClient: ReplicaTaskClient,
private val clusterNodeClient: ClusterNodeClient,
private val pipelineNodeService: PipelineNodeService,
private val ciPermissionManager: CIPermissionManager
private val ciPermissionManager: CIPermissionManager,
private val blockNodeServiceImpl: BlockNodeServiceImpl,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里要依赖接口

val sha256 = getArtifactSha256()

val offset = context.request.getHeader(HEADER_OFFSET)?.toLongOrNull()
val expires = storageProperties.filesystem.cache.expireDuration
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

取错配置了


val node = nodeService.getNodeDetail(this)

val expires = getLongHeader(HEADER_EXPIRES).takeIf { it > 0 } ?: TRANSACTION_EXPIRES
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不需要支持用户配置,支持服务内配置限制最大过期时间即可

)

// 获取节点信息并验证节点是否存在
val node = ArtifactContextHolder.getNodeDetail(artifactInfo) ?: run {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

此处为什么要验证节点是否存在

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants