This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.1 by this push:
     new 0dd1473a812 branch-4.1: [feat](cloud) add drop_snapshot http api 
#61687 (#61708)
0dd1473a812 is described below

commit 0dd1473a81207d61860b3a2c46cbe7190ef7e06b
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Thu Mar 26 09:28:35 2026 +0800

    branch-4.1: [feat](cloud) add drop_snapshot http api #61687 (#61708)
    
    Cherry-picked from #61687
    
    Co-authored-by: walter <[email protected]>
---
 cloud/src/meta-service/meta_service_http.cpp | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/cloud/src/meta-service/meta_service_http.cpp 
b/cloud/src/meta-service/meta_service_http.cpp
index 2656b63f8bd..c3ecff50a9a 100644
--- a/cloud/src/meta-service/meta_service_http.cpp
+++ b/cloud/src/meta-service/meta_service_http.cpp
@@ -734,6 +734,23 @@ static HttpResponse process_list_snapshot(MetaServiceImpl* 
service, brpc::Contro
     return http_json_reply_message(resp.status(), resp);
 }
 
+static HttpResponse process_drop_snapshot(MetaServiceImpl* service, 
brpc::Controller* ctrl) {
+    auto& uri = ctrl->http_request().uri();
+    std::string instance_id(http_query(uri, "instance_id"));
+    std::string snapshot_id(http_query(uri, "snapshot_id"));
+    if (instance_id.empty()) {
+        return http_json_reply(MetaServiceCode::INVALID_ARGUMENT, "instance_id 
is empty");
+    }
+    if (snapshot_id.empty()) {
+        return http_json_reply(MetaServiceCode::INVALID_ARGUMENT, "snapshot_id 
is empty");
+    }
+    DropSnapshotRequest req;
+    req.set_snapshot_id(snapshot_id);
+    DropSnapshotResponse resp;
+    service->snapshot_manager()->drop_snapshot(instance_id, req, &resp);
+    return http_json_reply(resp.status());
+}
+
 static HttpResponse process_compact_snapshot(MetaServiceImpl* service, 
brpc::Controller* ctrl) {
     auto& uri = ctrl->http_request().uri();
     std::string instance_id(http_query(uri, "instance_id"));
@@ -988,10 +1005,12 @@ void 
MetaServiceImpl::http(::google::protobuf::RpcController* controller,
             {"v1/get_cluster_status", process_get_cluster_status},
             // snapshot related
             {"list_snapshot", process_list_snapshot},
+            {"drop_snapshot", process_drop_snapshot},
             {"set_snapshot_property", process_set_snapshot_property},
             {"get_snapshot_property", process_get_snapshot_property},
             {"set_multi_version_status", process_set_multi_version_status},
             {"v1/list_snapshot", process_list_snapshot},
+            {"v1/drop_snapshot", process_drop_snapshot},
             {"v1/set_snapshot_property", process_set_snapshot_property},
             {"v1/get_snapshot_property", process_get_snapshot_property},
             {"v1/set_multi_version_status", process_set_multi_version_status},


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to