Skip to content

Conversation

@pthirun
Copy link
Contributor

@pthirun pthirun commented Jan 28, 2026

Problem Statement

As part of the controller gRPC migration, the deleteStore API needs to be available via gRPC while maintaining the existing HTTP endpoint during the migration period. This follows the same pattern established by other controller API migrations, where business logic is abstracted so both HTTP and gRPC can share the same implementation.

Solution

Added gRPC support for the deleteStore API following the established migration pattern:

  1. Proto definitions (StoreGrpcService.proto): Added deleteStore RPC method with DeleteStoreGrpcRequest and DeleteStoreGrpcResponse messages
  2. Request handler (StoreRequestHandler.java): Added deleteStore() method that validates parameters and calls admin.deleteStore(), returning a gRPC response
  3. gRPC service implementation (StoreGrpcServiceImpl.java): Added deleteStore() override with ACL checks (matching the HTTP endpoint behavior)
  4. HTTP route update (StoresRoutes.java): Updated to convert HTTP requests to gRPC format and delegate to the shared handler
  5. Route registration (AdminSparkServer.java): No changes needed - handler already passed to StoresRoutes constructor

The implementation reuses the existing business logic in Admin.deleteStore(), ensuring consistency between HTTP and gRPC endpoints.

Code changes

  • Added new code behind a config. If so list the config names and their default values in the PR description.
  • Introduced new log lines.
    • Confirmed if logs need to be rate limited to avoid excessive logging. (Info/Debug level logging only, consistent with other gRPC endpoints)

Concurrency-Specific Checks

Both reviewer and PR author to verify

  • Code has no race conditions or thread safety issues. (Stateless request handling, delegates to existing thread-safe Admin methods)
  • Proper synchronization mechanisms (e.g., synchronized, RWLock) are used where needed. (Uses existing AdminCommandExecutionTracker synchronization pattern)
  • No blocking calls inside critical sections that could lead to deadlocks or performance degradation. (N/A - no critical sections)
  • Verified thread-safe collections are used (e.g., ConcurrentHashMap, CopyOnWriteArrayList). (N/A - no collections introduced)
  • Validated proper exception handling in multi-threaded code to avoid silent thread termination. (Uses handleRequest() utility for consistent error handling)

How was this PR tested?

  • New unit tests added.
    • testDeleteStoreReturnsSuccessfulResponse - Verifies successful response with execution ID
    • testDeleteStoreReturnsSuccessfulResponseWithoutExecutionId - Verifies response without execution ID
    • testDeleteStoreWithAbortMigrationCleanup - Verifies abort migration cleanup flag
    • testDeleteStoreReturnsErrorResponse - Verifies error handling
    • testDeleteStoreReturnsPermissionDenied - Verifies ACL enforcement
    • testDeleteStoreReturnsBadRequestForInvalidArgument - Verifies invalid argument handling
    • testDeleteStore (StoresRoutesTest) - Verifies HTTP route integration with handler
    • testDeleteStoreSuccess - Verifies request handler success path
    • testDeleteStoreWithAbortMigrationCleanup - Verifies request handler with flag
    • testDeleteStoreWithExecutionTracker - Verifies execution ID tracking
    • testDeleteStoreThrowsException - Verifies exception handling
    • testDeleteStoreMissingClusterName - Verifies validation
    • testDeleteStoreMissingStoreName - Verifies validation
  • New integration tests added.
    • testDeleteStoreGrpcEndpoint - End-to-end test for deleteStore via gRPC
    • testDeleteStoreOverSecureGrpcChannel - Secure channel ACL enforcement test
  • Modified or extended existing tests.
  • Code coverage verified.
    • Generated Jacoco coverage report: ./gradlew :services:venice-controller:test :services:venice-controller:jacocoTestReport
    • Verified comprehensive test coverage for all new methods
  • Verified backward compatibility (if applicable). (HTTP endpoint unchanged, gRPC is additive)

Does this PR introduce any user-facing or breaking changes?

  • No. You can skip the rest of this section.
  • Yes. Clearly explain the behavior change and its impact.

Add gRPC support for the deleteStore endpoint while
maintaining backward compatibility with the existing HTTP endpoint.

Changes:
- Add deleteStore RPC to StoreGrpcService.proto
- Add handler method to StoreRequestHandler
- Add gRPC service implementation
- Update HTTP route to convert requests to gRPC format
- Add comprehensive unit and integration tests
@pthirun
Copy link
Contributor Author

pthirun commented Jan 29, 2026

/rerun-ci

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.

1 participant