You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
背景
#127 和 #128 已经调整为“管理员托管 storage backend”方向:管理员授权 OneDrive / Google Drive 账号作为统一存储池,普通用户上传的 AsterDrive blob 可以落到这些存储策略命中的后端。
但“从外部云盘导入 / 同步文件到 AsterDrive”是另一条产品线,复杂度明显更高,暂时不适合直接开成可实现 issue。这里先用 discussion 跟踪设计边界和阶段拆分,避免把它和 storage driver 混在一起。
相关 issue:
核心边界
外部云盘导入 / 同步不是 storage driver。
storage backend 回答的是:
外部导入 / 同步回答的是:
导入后的文件仍应进入 AsterDrive 现有文件链路:
也就是说,从用户 Google Drive 导入的文件可以最终落到 Local、S3、COS、Google Drive storage backend、OneDrive storage backend,取决于 AsterDrive 当前存储策略。source connector 和 target storage backend 不能混成一个模型。
为什么暂时不直接做 issue
导入和同步涉及的面太多:
直接把这些塞进一个 issue,很容易变成范围失控。
和现有后台下载任务的关系
远程导入可以接近现有 offline download 后台任务,但不应该作为 offline download engine。
可以复用:
TaskExecutionContext取消检查workspace_storage_service::store_from_temp_internal()不应该复用为:
offline download 的 source 是 HTTP/HTTPS URL。外部云盘导入的 source 是 provider object,需要处理 connection、token refresh、remote metadata、export format、provider-specific error mapping。它应该是兄弟任务,而不是 offline download 的下载引擎。
建议未来任务类型:
建议阶段
1. External connection 基础
建立通用 external connection 模型,而不是 Google Drive / OneDrive 各自复制一套表。
可能需要:
连接表应能表达:
2. 远端浏览
提供只读浏览能力:
这一阶段不写入 AsterDrive 文件,只验证连接和远端对象模型。
3. 单文件导入
新增
RemoteImport后台任务。建议 payload 形状:
{ "provider": "google_drive", "connection_id": 42, "remote_file_id": "abc", "remote_revision": null, "export_mime": null, "target_folder_id": 100, "filename": null, "conflict_mode": "resolve_unique" }建议流程:
首版建议走:
不要第一版就重写 streaming import pipeline。那会同时碰到 hash、quota、dedup、失败回滚和 driver 写入链路,复杂度不值。
4. 文件夹批量导入
文件夹导入不建议把整个远端树塞进 task payload。
可选方案:
需要处理:
5. 单向同步
同步不是一个单纯后台任务,而是长期 binding + 多次 task run。
建议模型:
binding 记录:
mapping 记录:
没有 mapping 表,同步会很难判断远端删除、rename/move、重复导入和本地冲突。
首版建议
如果未来要落地,我建议最小可行范围是:
同步应该等单文件导入和远端浏览稳定后再做。
非目标建议
首个实现 issue 不建议包含:
待决问题
All reactions