From 7964c44d02462f81c36b3733d66a28561ea68c92 Mon Sep 17 00:00:00 2001 From: Yevgeny Pats <16490766+yevgenypats@users.noreply.github.com> Date: Sat, 1 Jul 2023 19:33:54 +0300 Subject: [PATCH 1/2] fix: State add flush and fix migration bug --- internal/clients/state/v3/state.go | 6 ++++-- state/state.go | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/internal/clients/state/v3/state.go b/internal/clients/state/v3/state.go index d4c01fc375..acc1d39a02 100644 --- a/internal/clients/state/v3/state.go +++ b/internal/clients/state/v3/state.go @@ -3,7 +3,6 @@ package state import ( "bytes" "context" - "fmt" "io" "sync" @@ -71,6 +70,9 @@ func NewClient(ctx context.Context, pbClient pb.PluginClient, tableName string) }); err != nil { return nil, err } + if _, err := writeClient.CloseAndRecv(); err != nil { + return nil, err + } readClient, err := c.client.Read(ctx, &pb.Read_Request{ Table: tableBytes, @@ -158,5 +160,5 @@ func (c *Client) GetKey(_ context.Context, key string) (string, error) { if val, ok := c.mem[key]; ok { return val, nil } - return "", fmt.Errorf("key not found") + return "", nil } diff --git a/state/state.go b/state/state.go index d90b595ef2..a2f05737e7 100644 --- a/state/state.go +++ b/state/state.go @@ -14,6 +14,7 @@ import ( type Client interface { SetKey(ctx context.Context, key string, value string) error GetKey(ctx context.Context, key string) (string, error) + Flush(ctx context.Context) error } func NewClient(ctx context.Context, conn *grpc.ClientConn, tableName string) (Client, error) { From bc81cc1117d3ef0a9aff6bc53ae9235b991da439 Mon Sep 17 00:00:00 2001 From: Yevgeny Pats <16490766+yevgenypats@users.noreply.github.com> Date: Sat, 1 Jul 2023 19:37:44 +0300 Subject: [PATCH 2/2] comment benchmark results --- .github/workflows/{unittest-post.yml => unittest-post.yml.backup} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{unittest-post.yml => unittest-post.yml.backup} (100%) diff --git a/.github/workflows/unittest-post.yml b/.github/workflows/unittest-post.yml.backup similarity index 100% rename from .github/workflows/unittest-post.yml rename to .github/workflows/unittest-post.yml.backup