Skip to content

Commit

Permalink
Remove query consistency level from request (#160)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexshtin committed Jun 13, 2020
1 parent 4b1863d commit 2be0608
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 17 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ require (
github.com/uber-go/tally v3.3.17+incompatible
github.com/uber/jaeger-client-go v2.23.1+incompatible
github.com/uber/jaeger-lib v2.2.0+incompatible // indirect
go.temporal.io/temporal-proto v0.24.2
go.temporal.io/temporal-proto v0.24.3
go.uber.org/atomic v1.6.0
go.uber.org/goleak v1.0.0
go.uber.org/zap v1.15.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ github.com/uber/jaeger-client-go v2.23.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMW
github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw=
github.com/uber/jaeger-lib v2.2.0+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.temporal.io/temporal-proto v0.24.2 h1:XZRX9+kB63jn6crfst2Sth3r8scabEqoXksUQu3q91k=
go.temporal.io/temporal-proto v0.24.2/go.mod h1:upayz+pnLT5z2lzh/qktmSnouTTl+WYcjbMoejagmzU=
go.temporal.io/temporal-proto v0.24.3 h1:ZTmKRv0f1JFYEte5fNzER24qujSd+qHs4wKAVuTv4e0=
go.temporal.io/temporal-proto v0.24.3/go.mod h1:upayz+pnLT5z2lzh/qktmSnouTTl+WYcjbMoejagmzU=
go.uber.org/atomic v1.6.0 h1:Ezj3JGmsOnG1MoRWQkPBsKLe9DwWD9QeXzTRzzldNVk=
go.uber.org/atomic v1.6.0/go.mod h1:sABNBOSYdrvTF6hTgEIbc7YasKWGhgEQZyfxyTvoXHQ=
go.uber.org/goleak v1.0.0 h1:qsup4IcBdlmsnGfqyLl4Ntn3C2XCCuKAE7DwHpScyUo=
Expand Down
14 changes: 4 additions & 10 deletions internal/internal_workflow_client.go
Original file line number Diff line number Diff line change
Expand Up @@ -837,15 +837,10 @@ type QueryWorkflowWithOptionsRequest struct {
// Args is an optional field used to identify the arguments passed to the query.
Args []interface{}

// QueryRejectCondition is an optional field used to reject queries based on workflow state.
// QueryRejectConditionNotOpen will reject queries to workflows which are not open
// QueryRejectConditionNotCompletedCleanly will reject queries to workflows which completed in any state other than completed (e.g. terminated, canceled timeout etc...)
// QUERY_REJECT_CONDITION_UNSPECIFIED is an optional field used to reject queries based on workflow state.
// QUERY_REJECT_CONDITION_NOT_OPEN will reject queries to workflows which are not open.
// QUERY_REJECT_CONDITION_NOT_COMPLETED_CLEANLY will reject queries to workflows which completed in any state other than completed (e.g. terminated, canceled timeout etc...).
QueryRejectCondition enumspb.QueryRejectCondition

// QueryConsistencyLevel is an optional field used to control the consistency level.
// QueryConsistencyLevelEventual means that query will eventually reflect up to date state of a workflow.
// QueryConsistencyLevelStrong means that query will reflect a workflow state of having applied all events which came before the query.
QueryConsistencyLevel enumspb.QueryConsistencyLevel
}

// QueryWorkflowWithOptionsResponse is the response to QueryWorkflowWithOptions
Expand Down Expand Up @@ -883,8 +878,7 @@ func (wc *WorkflowClient) QueryWorkflowWithOptions(ctx context.Context, request
QueryType: request.QueryType,
QueryArgs: input,
},
QueryRejectCondition: request.QueryRejectCondition,
QueryConsistencyLevel: request.QueryConsistencyLevel,
QueryRejectCondition: request.QueryRejectCondition,
}

var resp *workflowservice.QueryWorkflowResponse
Expand Down
7 changes: 3 additions & 4 deletions test/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,9 @@ func (ts *IntegrationTestSuite) TestConsistentQuery() {
ts.NoError(err)

value, err := ts.client.QueryWorkflowWithOptions(ctx, &client.QueryWorkflowWithOptionsRequest{
WorkflowID: "test-consistent-query",
RunID: run.GetRunID(),
QueryType: "consistent_query",
QueryConsistencyLevel: enumspb.QUERY_CONSISTENCY_LEVEL_STRONG,
WorkflowID: "test-consistent-query",
RunID: run.GetRunID(),
QueryType: "consistent_query",
})
ts.Nil(err)
ts.NotNil(value)
Expand Down

0 comments on commit 2be0608

Please sign in to comment.