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

refactor: Convert VFolder deletion from blocking response to event-driven pattern #3063

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

fregataa
Copy link
Member

@fregataa fregataa commented Nov 9, 2024

resolves #3060

As is

sequenceDiagram
    participant Client
    participant Manager
    participant StorageProxy
    participant FileSystem


    Client->>Manager: Request VFolder deletion
    Manager->>Manager: Update VFolder status to "DELETE-ONGOING"
    Manager->>Client: Response
    activate Manager
    Note right of Manager: Spawn async task
    Manager->>StorageProxy: HTTP Request
    StorageProxy->>FileSystem: Delete tree
    Note over StorageProxy,FileSystem: Long term job
    FileSystem->>StorageProxy: Finish
    StorageProxy->>Manager: HTTP 204 Response
    alt Deletion Success
        Manager->>Manager: Update VFolder status to "DELETE-COMPLETE"
    else
        Manager->>Manager: Update VFolder status to "DELETE-ERROR"
    end
    deactivate Manager
Loading

To do

sequenceDiagram
    participant Client
    participant Manager
    participant StorageProxy
    participant FileSystem
    participant EventBus


    Client->>Manager: Request VFolder deletion
    Manager->>Manager: Update VFolder status to "DELETE-ONGOING"
    Manager->>StorageProxy: HTTP Request
    
    opt VFolder not found
        StorageProxy->>Manager: HTTP 404 Response
        Manager->>Manager: Update VFolder status to "DELETE-COMPLETE"
        Manager->>Client: Response
    end
    
    activate StorageProxy
    Note right of StorageProxy: Spawn async task
    StorageProxy->>Manager: HTTP 202 Response
    Manager->>Client: Response
    StorageProxy->>FileSystem: Delete tree
    Note over StorageProxy,FileSystem: Long term job
    FileSystem->>StorageProxy: Finish
    StorageProxy-->> EventBus: Publish deletion-finish event
    deactivate StorageProxy

    EventBus-->>Manager: Consume deletion-finish event
    alt Deletion Success
        Manager->>Manager: Update VFolder status to "DELETE-COMPLETE"
    else
        Manager->>Manager: Update VFolder status to "DELETE-ERROR"
    end
Loading

Checklist: (if applicable)

  • Milestone metadata specifying the target backport version
  • Mention to the original issue
  • API server-client counterparts (e.g., manager API -> client SDK)

Copy link
Member Author

fregataa commented Nov 9, 2024

@github-actions github-actions bot added comp:manager Related to Manager component comp:common Related to Common component comp:storage-proxy Related to Storage proxy component size:L 100~500 LoC labels Nov 9, 2024
@fregataa fregataa added this to the 24.12 milestone Nov 9, 2024
@fregataa fregataa force-pushed the topic/11-09-chore_add_VFolderID_deserializer_function branch from bbacdea to 7d5c76c Compare November 10, 2024 02:31
@fregataa fregataa force-pushed the topic/11-09-refactor_convert_vfolder_deletion_from_blocking_response_to_event-driven_pattern branch from 16f4cc5 to e197a85 Compare November 10, 2024 02:31
@fregataa fregataa force-pushed the topic/11-09-chore_add_VFolderID_deserializer_function branch from 7d5c76c to ae81f93 Compare November 12, 2024 02:10
@fregataa fregataa force-pushed the topic/11-09-refactor_convert_vfolder_deletion_from_blocking_response_to_event-driven_pattern branch from e197a85 to 03d1686 Compare November 12, 2024 02:10
Base automatically changed from topic/11-09-chore_add_VFolderID_deserializer_function to main November 12, 2024 04:04
@fregataa fregataa force-pushed the topic/11-09-refactor_convert_vfolder_deletion_from_blocking_response_to_event-driven_pattern branch 2 times, most recently from 46d4951 to 23f5551 Compare November 12, 2024 21:17
@fregataa fregataa force-pushed the topic/11-09-refactor_convert_vfolder_deletion_from_blocking_response_to_event-driven_pattern branch from 23f5551 to 652376c Compare November 12, 2024 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp:common Related to Common component comp:manager Related to Manager component comp:storage-proxy Related to Storage proxy component size:L 100~500 LoC
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Convert vfolder deletion from blocking response to event-driven pattern
1 participant