Take the vfolder share cap off when its mount permissions are deleted
- Dominant language
- Python
- Stars
- 670
- Forks
- 183
- Avg merge
- 15h 13m
- Merged PRs (30d)
- 368
Description
vfolder 삭제 경로가 마운트 권한 행을 지우면서 share cap 은 남긴다. 두 표가 그 시점부터 어긋난다.
배경
vfolder 행과 그 virtual entity 는 세션과 같은 결로 남긴다. 스토리지 payload 가 지워지고 상태가 DELETE_COMPLETE 로 가도 행은 관리자가 purge 를 칠 때까지 살아 있다. 그래서 폴더 purge 의 캐스케이드가 cap 을 걷어주지 않는다.
지우는 자리가 두 곳이다.
- delete_vfolder_relation_rows (models/vfolder/row.py) - delete_vfolders_forever 가 부른다
- initiate_vfolder_deletion (repositories/vfolder/deletion.py) - VFolderPermissionBatchPurger
대상
- VFolderPermissionBatchPurger.to_data 가 권한 행 id 대신 grantee user id 를 돌려주게 한다. 지운 목록을 그 자리에서 받아 각자의 개인 프로젝트에서 unshare 한다.
- 두 자리 모두 같은 트랜잭션 안에서 마운트 행과 cap 을 함께 뗀다.
완료 기준
- 삭제 경로를 지난 vfolder 에 대해 vfolder_permissions 행과 share cap 이 둘 다 없다.
- vfolder 행과 virtual entity, 소유 관계는 그대로 둔다.
제약
- 이중쓰기는 유지한다. 읽기가 아직 레거시 표를 본다.
- 같은 행을 두 곳에서 중복 삭제하는 것 자체는 이 이슈에서 다루지 않는다.
JIRA Issue: BA-7724
Contributor guide
Research direction
Start with delete_vfolder_relation_rows in models/vfolder/row.py and initiate_vfolder_deletion in repositories/vfolder/deletion.py, then inspect VFolderPermissionBatchPurger.to_data and the delete_vfolders_forever call path. Verify that both deletion paths remove vfolder_permissions rows and share caps in one transaction while retaining the vfolder row, virtual entity, and ownership relation; preserve the legacy-table dual write.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- backend, database
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Clearly specified
- Newbie friendliness
- 65/100