From 110174bebee28bd4a4e69921ebc3c0bbff4d7594 Mon Sep 17 00:00:00 2001 From: sunby Date: Wed, 27 Oct 2021 20:32:43 +0800 Subject: [PATCH] [skip ci]Add comment for FlushSegments (#10775) Signed-off-by: sunby --- internal/distributed/datanode/client/client.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/internal/distributed/datanode/client/client.go b/internal/distributed/datanode/client/client.go index 240ff30261..95f16c06fb 100644 --- a/internal/distributed/datanode/client/client.go +++ b/internal/distributed/datanode/client/client.go @@ -246,6 +246,14 @@ func (c *Client) WatchDmChannels(ctx context.Context, req *datapb.WatchDmChannel return ret.(*commonpb.Status), err } +// FlushSegments notifies DataNode to flush the segments req provids. The flush tasks are async to this +// rpc, DataNode will flush the segments in the background. +// +// Return UnexpectedError code in status: +// If DataNode isn't in HEALTHY: states not HEALTHY or dynamic checks not HEALTHY +// If DataNode doesn't find the correspounding segmentID in its memeory replica +// Return Success code in status and trigers background flush: +// Log an info log if a segment is under flushing func (c *Client) FlushSegments(ctx context.Context, req *datapb.FlushSegmentsRequest) (*commonpb.Status, error) { ret, err := c.recall(func() (interface{}, error) { client, err := c.getGrpcClient()