Vald Remove APIs

Overview

Remove Service is responsible for removing vectors indexed in the vald-agent.

service Remove {

  rpc Remove(payload.v1.Remove.Request) returns (payload.v1.Object.Location) {}

  rpc RemoveByTimestamp(payload.v1.Remove.TimestampRequest) returns (payload.v1.Object.Locations) {}

  rpc StreamRemove(stream payload.v1.Remove.Request)
      returns (stream payload.v1.Object.StreamLocation) {}

  rpc MultiRemove(payload.v1.Remove.MultiRequest)
      returns (payload.v1.Object.Locations) {}
}

Remove RPC

Remove RPC is the method to remove a single vector.

Input

  • the scheme of payload.v1.Remove.Request

    message Remove {
        message Request {
            Object.ID id = 1;
            Config config = 2;
        }
    
        message Config {
            bool skip_strict_exist_check = 1;
            int64 timestamp = 3;
        }
    }
    
    message Object {
        message ID {
            string id = 1 [ (validate.rules).string.min_len = 1 ];
        }
    }
    
    • Remove.Request

      fieldtypelabelrequireddescription
      idObject.ID*The ID of vector.
      configConfig*The configuration of the remove request.
    • Remove.Config

      fieldtypelabelrequireddescription
      skip_strict_exist_checkboolCheck whether the same vector is already inserted or not.
      The ID should be unique if the value is true.
      timestampint64The timestamp of the vector removed.
      If it is N/A, the current time will be used.
    • Object.ID

      fieldtypelabelrequireddescription
      idstring*The ID of a vector. ID should consist of 1 or more characters.

Output

  • the scheme of payload.v1.Object.Location

    message Object {
        message Location {
          string name = 1;
          string uuid = 2;
          repeated string ips = 3;
        }
    }
    
    • Object.Location
      fieldtypelabeldescription
      namestringThe name of vald agent pod where the request vector is removed.
      uuidstringThe ID of the removed vector. It is the same as an Object.ID.
      ipsstringrepeated(Array[string])The IP list of vald-agent pods where the request vector is removed.

Status Code

codename
0OK
1CANCELLED
3INVALID_ARGUMENT
4DEADLINE_EXCEEDED
5NOT_FOUND
10ABORTED
13INTERNAL

Please refer to Response Status Code for more details.

Troubleshooting

The request process may not be completed when the response code is NOT 0 (OK).

Here are some common reasons and how to resolve each error.

namecommon reasonhow to resolve
CANCELLEDExecuted cancel() of rpc from client/server-side or network problems between client and server.Check the code, especially around timeout and connection management, and fix if needed.
INVALID_ARGUMENTThe Requested vector’s ID is empty, or some request payload is invalid.Check request payload and fix request payload.
DEADLINE_EXCEEDEDThe RPC timeout setting is too short on the client/server side.Check the gRPC timeout setting on both the client and server sides and fix it if needed.
NOT_FOUNDRequested ID is NOT inserted.Send a request with an ID that is already inserted.
INTERNALTarget Vald cluster or network route has some critical error.Check target Vald cluster first and check network route including ingress as second.

RemoveByTimestamp RPC

RemoveByTimestamp RPC is the method to remove vectors based on timestamp.

Input

  • the scheme of payload.v1.Remove.TimestampRequest

    message Remove {
        message TimestampRequest {
            repeated Timestamp timestamps = 1;
        }
    
        message Timestamp {
            enum Operator {
                Eq = 0;
                Ne = 1;
                Ge = 2;
                Gt = 3;
                Le = 4;
                Lt = 5;
            }
            int64 timestamp = 1;
            Operator operator = 2;
        }
    }
    
    message Object {
        message ID {
            string id = 1 [ (validate.rules).string.min_len = 1 ];
        }
    }
    
    • Remove.TimestampRequest

      fieldtypelabelrequireddescription
      timestampsRemove.Timestamprepeated(Array[Remove.Timestamp])*The timestamp comparison list.
      If more than one is specified, the AND search is applied.
    • Remove.Timestamp

      fieldtypelabelrequireddescription
      timestampint64*The timestamp.
      operatorRemove.Timestamp.OperatorThe conditional operator. (default value is Eq).
    • Remove.Timestamp.Operator

      valuedescription
      EqEqual.
      NeNot Equal.
      GeGreater than or Equal.
      GtGreater than.
      LeLess than or Equal.
      LtLess than.
    In the TimestampRequest message, the 'timestamps' field is repeated, allowing the inclusion of multiple Timestamp.
    When multiple Timestamps are provided, it results in an `AND` condition, enabling the realization of deletions with specified ranges.
    This design allows for versatile deletion operations, facilitating tasks such as removing data within a specific time range.

Output

  • the scheme of payload.v1.Object.Locations.

    message Object {
        message Locations { repeated Location locations = 1; }
    
        message Location {
          string name = 1;
          string uuid = 2;
          repeated string ips = 3;
        }
    }
    
    • Object.Locations

      fieldtypelabeldescription
      locationObject.Locationrepeated(Array[Object.Location])The list of Object.Location.
    • Object.Location

      fieldtypelabeldescription
      namestringThe name of vald agent pod where the request vector is removed.
      uuidstringThe ID of the removed vector. It is the same as an Object.ID.
      ipsstringrepeated(Array[string])The IP list of vald-agent pods where the request vector is removed.

Status Code

codename
0OK
1CANCELLED
4DEADLINE_EXCEEDED
5NOT_FOUND
13INTERNAL

Please refer to Response Status Code for more details.

Troubleshooting

The request process may not be completed when the response code is NOT 0 (OK).

Here are some common reasons and how to resolve each error.

namecommon reasonhow to resolve
CANCELLEDExecuted cancel() of rpc from client/server-side or network problems between client and server.Check the code, especially around timeout and connection management, and fix if needed.
DEADLINE_EXCEEDEDThe RPC timeout setting is too short on the client/server side.Check the gRPC timeout setting on both the client and server sides and fix it if needed.
NOT_FOUNDNo vectors in the system match the specified timestamp conditions.Check whether vectors matching the specified timestamp conditions exist in the system, and fix conditions if needed.
INTERNALTarget Vald cluster or network route has some critical error.Check target Vald cluster first and check network route including ingress as second.

StreamRemove RPC

StreamRemove RPC is the method to remove multiple vectors using the bidirectional streaming RPC.
Using the bidirectional streaming RPC, the remove request can be communicated in any order between client and server. Each Remove request and response are independent. It’s the recommended method to remove a large number of vectors.

Input

  • the scheme of payload.v1.Remove.Request stream

    message Remove {
        message Request {
            Object.ID id = 1;
            Config config = 2;
        }
    
        message Config {
            bool skip_strict_exist_check = 1;
            int64 timestamp = 3;
        }
    }
    
    message Object {
        message ID {
            string id = 1 [ (validate.rules).string.min_len = 1 ];
        }
    }
    
    • Remove.Request

      fieldtypelabelrequireddescription
      idObject.ID*The ID of vector.
      configConfig*The configuration of the insert request.
    • Remove.Config

      fieldtypelabelrequireddescription
      skip_strict_exist_checkboolCheck whether the same vector is already inserted or not.
      The ID should be unique if the value is true.
      timestampint64The timestamp of the vector removed.
      If it is N/A, the current time will be used.
    • Object.ID

      fieldtypelabelrequireddescription
      idstring*The ID of a vector. ID should consist of 1 or more characters.

Output

  • the scheme of payload.v1.Object.StreamLocation

    message Object {
        message StreamLocation {
          oneof payload {
              Location location = 1;
              google.rpc.Status status = 2;
          }
        }
    
        message Location {
          string name = 1;
          string uuid = 2;
          repeated string ips = 3;
        }
    }
    
    • Object.StreamLocation

      fieldtypelabeldescription
      locationObject.LocationThe information of Object.Location data.
      statusgoogle.rpc.StatusThe status of Google RPC
    • Object.Location

      fieldtypelabeldescription
      namestringThe name of vald agent pod where the request vector is removed.
      uuidstringThe ID of the removed vector. It is the same as an Object.ID.
      ipsstringrepeated(Array[string])The IP list of vald-agent pods where the request vector is removed.
    • google.rpc.Status

      fieldtypelabeldescription
      codeint32Status code (code list is next section)
      messagestringError message
      detailsgoogle.protobuf.Anyrepeated(Array[any])The details error message list

Status Code

codename
0OK
1CANCELLED
3INVALID_ARGUMENT
4DEADLINE_EXCEEDED
5NOT_FOUND
10ABORTED
13INTERNAL

Please refer to Response Status Code for more details.

Troubleshooting

The request process may not be completed when the response code is NOT 0 (OK).

Here are some common reasons and how to resolve each error.

namecommon reasonhow to resolve
CANCELLEDExecuted cancel() of rpc from client/server-side or network problems between client and server.Check the code, especially around timeout and connection management, and fix if needed.
INVALID_ARGUMENTThe Requested vector’s ID is empty, or some request payload is invalid.Check request payload and fix request payload.
DEADLINE_EXCEEDEDThe RPC timeout setting is too short on the client/server side.Check the gRPC timeout setting on both the client and server sides and fix it if needed.
NOT_FOUNDRequested ID is NOT inserted.Send a request with an ID that is already inserted.
INTERNALTarget Vald cluster or network route has some critical error.Check target Vald cluster first and check network route including ingress as second.

MultiRemove RPC

MultiRemove is the method to remove multiple vectors in 1 request.

gRPC has a message size limitation.
Please be careful that the size of the request exceeds the limit.

Input

  • the scheme of payload.v1.Remove.MultiRequest

    message Remove {
        message MultiRequest {
          repeated Request requests = 1;
        }
    
        message Request {
            Object.ID id = 1;
            Config config = 2;
        }
    
        message Config {
            bool skip_strict_exist_check = 1;
            int64 timestamp = 3;
        }
    }
    
    message Object {
        message ID {
            string id = 1 [ (validate.rules).string.min_len = 1 ];
        }
    }
    
    • Remove.MultiRequest

      fieldtypelabelrequireddescription
      requestsRemove.Requestrepeated(Array[Insert.Request])*the request list
    • Remove.Request

      fieldtypelabelrequireddescription
      idObject.ID*The ID of vector.
      configConfig*The configuration of the remove request.
    • Remove.Config

      fieldtypelabelrequireddescription
      skip_strict_exist_checkboolCheck whether the same vector is already inserted or not.
      The ID should be unique if the value is true.
      timestampint64The timestamp of the vector removed.
      If it is N/A, the current time will be used.
    • Object.ID

      fieldtypelabelrequireddescription
      idstring*The ID of a vector. ID should consist of 1 or more characters.

Output

  • the scheme of payload.v1.Object.Locations.

    message Object {
        message Locations { repeated Location locations = 1; }
    
        message Location {
          string name = 1;
          string uuid = 2;
          repeated string ips = 3;
        }
    }
    
    • Object.Locations

      fieldtypelabeldescription
      locationObject.Locationrepeated(Array[Object.Location])The list of Object.Location.
    • Object.Location

      fieldtypelabeldescription
      namestringThe name of vald agent pod where the request vector is removed.
      uuidstringThe ID of the removed vector. It is the same as an Object.ID.
      ipsstringrepeated(Array[string])The IP list of vald-agent pods where the request vector is removed.

Status Code

codename
0OK
1CANCELLED
3INVALID_ARGUMENT
4DEADLINE_EXCEEDED
5NOT_FOUND
10ABORTED
13INTERNAL

Please refer to Response Status Code for more details.

Troubleshooting

The request process may not be completed when the response code is NOT 0 (OK).

Here are some common reasons and how to resolve each error.

namecommon reasonhow to resolve
CANCELLEDExecuted cancel() of rpc from client/server-side or network problems between client and server.Check the code, especially around timeout and connection management, and fix if needed.
INVALID_ARGUMENTThe Requested vector’s ID is empty, or some request payload is invalid.Check request payload and fix request payload.
DEADLINE_EXCEEDEDThe RPC timeout setting is too short on the client/server side.Check the gRPC timeout setting on both the client and server sides and fix it if needed.
NOT_FOUNDRequested ID is NOT inserted.Send a request with an ID that is already inserted.
INTERNALTarget Vald cluster or network route has some critical error.Check target Vald cluster first and check network route including ingress as second.

See also