Skip to content

Commit

Permalink
Merge branch 'master' into test_nosql_history_storage_DeleteHistoryBr…
Browse files Browse the repository at this point in the history
…anch
  • Loading branch information
jakobht authored Apr 27, 2024
2 parents 4ffc662 + cf2f77a commit 607b6d9
Show file tree
Hide file tree
Showing 24 changed files with 1,424 additions and 1,131 deletions.
72 changes: 68 additions & 4 deletions .gen/go/history/history.go

Large diffs are not rendered by default.

30 changes: 28 additions & 2 deletions .gen/go/shared/shared.go

Large diffs are not rendered by default.

657 changes: 346 additions & 311 deletions .gen/proto/history/v1/service.pb.go

Large diffs are not rendered by default.

917 changes: 459 additions & 458 deletions .gen/proto/history/v1/service.pb.yarpc.go

Large diffs are not rendered by default.

299 changes: 150 additions & 149 deletions .gen/proto/matching/v1/service.pb.yarpc.go

Large diffs are not rendered by default.

299 changes: 150 additions & 149 deletions .gen/proto/shared/v1/history.pb.yarpc.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cmd/server/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ require (
github.com/startreedata/pinot-client-go v0.2.0 // latest release supports pinot v0.12.0 which is also internal version
github.com/stretchr/testify v1.8.3
github.com/uber-go/tally v3.3.15+incompatible // indirect
github.com/uber/cadence-idl v0.0.0-20240326234200-e3a59cdd3c36
github.com/uber/cadence-idl v0.0.0-20240416202333-83d5cae7fc51
github.com/uber/ringpop-go v0.8.5 // indirect
github.com/uber/tchannel-go v1.22.2 // indirect
github.com/urfave/cli v1.22.4
Expand Down
4 changes: 2 additions & 2 deletions cmd/server/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -398,8 +398,8 @@ github.com/uber-go/tally v3.3.12+incompatible/go.mod h1:YDTIBxdXyOU/sCWilKB4bgyu
github.com/uber-go/tally v3.3.15+incompatible h1:9hLSgNBP28CjIaDmAuRTq9qV+UZY+9PcvAkXO4nNMwg=
github.com/uber-go/tally v3.3.15+incompatible/go.mod h1:YDTIBxdXyOU/sCWilKB4bgyufu1cEi0jdVnRdxvjnmU=
github.com/uber/cadence-idl v0.0.0-20211111101836-d6b70b60eb8c/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
github.com/uber/cadence-idl v0.0.0-20240326234200-e3a59cdd3c36 h1:75Uvw7a4Pqo5LrpAFfJehKSJT50JcF7dQolJj5/bUc4=
github.com/uber/cadence-idl v0.0.0-20240326234200-e3a59cdd3c36/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
github.com/uber/cadence-idl v0.0.0-20240416202333-83d5cae7fc51 h1:gAdDymipzIzh7PTPAW7DjFT2BOEwY7hwC0COsZIulsI=
github.com/uber/cadence-idl v0.0.0-20240416202333-83d5cae7fc51/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
github.com/uber/jaeger-client-go v2.22.1+incompatible h1:NHcubEkVbahf9t3p75TOCR83gdUHXjRJvjoBh1yACsM=
github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw=
Expand Down
6 changes: 6 additions & 0 deletions common/pinot/pinotQueryValidator.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,12 @@ func processCustomString(comparisonExpr *sqlparser.ComparisonExpr, colNameStr st
Type: sqlparser.StrVal,
Val: []byte("%" + colValStr + "%"),
}

if colValStr == "" {
return fmt.Sprintf("(JSON_MATCH(Attr, '\"$.%s\" is not null') "+
"AND REGEXP_LIKE(JSON_EXTRACT_SCALAR(Attr, '$.%s', 'string'), '^$'))", colNameStr, colNameStr)
}

return fmt.Sprintf("(JSON_MATCH(Attr, '\"$.%s\" is not null') "+
"AND REGEXP_LIKE(JSON_EXTRACT_SCALAR(Attr, '$.%s', 'string'), '%s*'))", colNameStr, colNameStr, colValStr)
}
Expand Down
6 changes: 5 additions & 1 deletion common/pinot/pinotQueryValidator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,14 @@ func TestValidateQuery(t *testing.T) {
query: "WorkflowID = 'wid'",
validated: "WorkflowID = 'wid'",
},
"Case3: query with custom field": {
"Case3-1: query with custom field": {
query: "CustomStringField = 'custom'",
validated: "(JSON_MATCH(Attr, '\"$.CustomStringField\" is not null') AND REGEXP_LIKE(JSON_EXTRACT_SCALAR(Attr, '$.CustomStringField', 'string'), 'custom*'))",
},
"Case3-2: query with custom field value is empty": {
query: "CustomStringField = ''",
validated: "(JSON_MATCH(Attr, '\"$.CustomStringField\" is not null') AND REGEXP_LIKE(JSON_EXTRACT_SCALAR(Attr, '$.CustomStringField', 'string'), '^$'))",
},
"Case4: custom field query with or in string": {
query: "CustomStringField='Or'",
validated: "(JSON_MATCH(Attr, '\"$.CustomStringField\" is not null') AND REGEXP_LIKE(JSON_EXTRACT_SCALAR(Attr, '$.CustomStringField', 'string'), 'Or*'))",
Expand Down
1 change: 1 addition & 0 deletions common/types/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ type RecordChildExecutionCompletedRequest struct {
InitiatedID int64 `json:"initiatedId,omitempty"`
CompletedExecution *WorkflowExecution `json:"completedExecution,omitempty"`
CompletionEvent *HistoryEvent `json:"completionEvent,omitempty"`
StartedID int64 `json:"startedId,omitempty"`
}

// GetDomainUUID is an internal getter (TBD...)
Expand Down
8 changes: 8 additions & 0 deletions common/types/mapper/proto/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,6 +332,8 @@ func FromCancelExternalWorkflowExecutionFailedCause(t *types.CancelExternalWorkf
switch *t {
case types.CancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution:
return apiv1.CancelExternalWorkflowExecutionFailedCause_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION
case types.CancelExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted:
return apiv1.CancelExternalWorkflowExecutionFailedCause_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_WORKFLOW_ALREADY_COMPLETED
}
panic("unexpected enum value")
}
Expand All @@ -342,6 +344,8 @@ func ToCancelExternalWorkflowExecutionFailedCause(t apiv1.CancelExternalWorkflow
return nil
case apiv1.CancelExternalWorkflowExecutionFailedCause_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION:
return types.CancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution.Ptr()
case apiv1.CancelExternalWorkflowExecutionFailedCause_CANCEL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_WORKFLOW_ALREADY_COMPLETED:
return types.CancelExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted.Ptr()
}
panic("unexpected enum value")
}
Expand Down Expand Up @@ -3283,6 +3287,8 @@ func FromSignalExternalWorkflowExecutionFailedCause(t *types.SignalExternalWorkf
switch *t {
case types.SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution:
return apiv1.SignalExternalWorkflowExecutionFailedCause_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION
case types.SignalExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted:
return apiv1.SignalExternalWorkflowExecutionFailedCause_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_WORKFLOW_ALREADY_COMPLETED
}
panic("unexpected enum value")
}
Expand All @@ -3293,6 +3299,8 @@ func ToSignalExternalWorkflowExecutionFailedCause(t apiv1.SignalExternalWorkflow
return nil
case apiv1.SignalExternalWorkflowExecutionFailedCause_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION:
return types.SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution.Ptr()
case apiv1.SignalExternalWorkflowExecutionFailedCause_SIGNAL_EXTERNAL_WORKFLOW_EXECUTION_FAILED_CAUSE_WORKFLOW_ALREADY_COMPLETED:
return types.SignalExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted.Ptr()
}
panic("unexpected enum value")
}
Expand Down
2 changes: 2 additions & 0 deletions common/types/mapper/proto/enum_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func TestCancelExternalWorkflowExecutionFailedCause(t *testing.T) {
for _, item := range []*types.CancelExternalWorkflowExecutionFailedCause{
nil,
types.CancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution.Ptr(),
types.CancelExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted.Ptr(),
} {
assert.Equal(t, item, ToCancelExternalWorkflowExecutionFailedCause(FromCancelExternalWorkflowExecutionFailedCause(item)))
}
Expand Down Expand Up @@ -297,6 +298,7 @@ func TestSignalExternalWorkflowExecutionFailedCause(t *testing.T) {
for _, item := range []*types.SignalExternalWorkflowExecutionFailedCause{
nil,
types.SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution.Ptr(),
types.SignalExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted.Ptr(),
} {
assert.Equal(t, item, ToSignalExternalWorkflowExecutionFailedCause(FromSignalExternalWorkflowExecutionFailedCause(item)))
}
Expand Down
2 changes: 2 additions & 0 deletions common/types/mapper/proto/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,6 +833,7 @@ func FromHistoryRecordChildExecutionCompletedRequest(t *types.RecordChildExecuti
InitiatedId: t.InitiatedID,
CompletedExecution: FromWorkflowExecution(t.CompletedExecution),
CompletionEvent: FromHistoryEvent(t.CompletionEvent),
StartedId: t.StartedID,
}
}

Expand All @@ -846,6 +847,7 @@ func ToHistoryRecordChildExecutionCompletedRequest(t *historyv1.RecordChildExecu
InitiatedID: t.InitiatedId,
CompletedExecution: ToWorkflowExecution(t.CompletedExecution),
CompletionEvent: ToHistoryEvent(t.CompletionEvent),
StartedID: t.StartedId,
}
}

Expand Down
2 changes: 2 additions & 0 deletions common/types/mapper/thrift/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,6 +629,7 @@ func FromRecordChildExecutionCompletedRequest(t *types.RecordChildExecutionCompl
InitiatedId: &t.InitiatedID,
CompletedExecution: FromWorkflowExecution(t.CompletedExecution),
CompletionEvent: FromHistoryEvent(t.CompletionEvent),
StartedId: &t.StartedID,
}
}

Expand All @@ -643,6 +644,7 @@ func ToRecordChildExecutionCompletedRequest(t *history.RecordChildExecutionCompl
InitiatedID: t.GetInitiatedId(),
CompletedExecution: ToWorkflowExecution(t.CompletedExecution),
CompletionEvent: ToHistoryEvent(t.CompletionEvent),
StartedID: t.GetStartedId(),
}
}

Expand Down
12 changes: 12 additions & 0 deletions common/types/mapper/thrift/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -415,6 +415,9 @@ func FromCancelExternalWorkflowExecutionFailedCause(t *types.CancelExternalWorkf
case types.CancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution:
v := shared.CancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution
return &v
case types.CancelExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted:
v := shared.CancelExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted
return &v
}
panic("unexpected enum value")
}
Expand All @@ -428,6 +431,9 @@ func ToCancelExternalWorkflowExecutionFailedCause(t *shared.CancelExternalWorkfl
case shared.CancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution:
v := types.CancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution
return &v
case shared.CancelExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted:
v := types.CancelExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted
return &v
}
panic("unexpected enum value")
}
Expand Down Expand Up @@ -4931,6 +4937,9 @@ func FromSignalExternalWorkflowExecutionFailedCause(t *types.SignalExternalWorkf
case types.SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution:
v := shared.SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution
return &v
case types.SignalExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted:
v := shared.SignalExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted
return &v
}
panic("unexpected enum value")
}
Expand All @@ -4944,6 +4953,9 @@ func ToSignalExternalWorkflowExecutionFailedCause(t *shared.SignalExternalWorkfl
case shared.SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution:
v := types.SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution
return &v
case shared.SignalExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted:
v := types.SignalExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted
return &v
}
panic("unexpected enum value")
}
Expand Down
2 changes: 2 additions & 0 deletions common/types/mapper/thrift/shared_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ func TestCancelExternalWorkflowExecutionFailedCauseConversion(t *testing.T) {
testCases := []*types.CancelExternalWorkflowExecutionFailedCause{
nil,
types.CancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution.Ptr(),
types.CancelExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted.Ptr(),
}

for _, original := range testCases {
Expand Down Expand Up @@ -2603,6 +2604,7 @@ func TestSignalExternalWorkflowExecutionFailedCauseConversion(t *testing.T) {
testCases := []*types.SignalExternalWorkflowExecutionFailedCause{
nil,
types.SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution.Ptr(),
types.SignalExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted.Ptr(),
}

for _, original := range testCases {
Expand Down
12 changes: 12 additions & 0 deletions common/types/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,8 @@ func (e CancelExternalWorkflowExecutionFailedCause) String() string {
switch w {
case 0:
return "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION"
case 1:
return "WORKFLOW_ALREADY_COMPLETED"
}
return fmt.Sprintf("CancelExternalWorkflowExecutionFailedCause(%d)", w)
}
Expand All @@ -391,6 +393,9 @@ func (e *CancelExternalWorkflowExecutionFailedCause) UnmarshalText(value []byte)
case "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION":
*e = CancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution
return nil
case "WORKFLOW_ALREADY_COMPLETED":
*e = CancelExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted
return nil
default:
val, err := strconv.ParseInt(s, 10, 32)
if err != nil {
Expand All @@ -409,6 +414,7 @@ func (e CancelExternalWorkflowExecutionFailedCause) MarshalText() ([]byte, error
const (
// CancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution is an option for CancelExternalWorkflowExecutionFailedCause
CancelExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution CancelExternalWorkflowExecutionFailedCause = iota
CancelExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted
)

// CancelTimerDecisionAttributes is an internal type (TBD...)
Expand Down Expand Up @@ -5739,6 +5745,8 @@ func (e SignalExternalWorkflowExecutionFailedCause) String() string {
switch w {
case 0:
return "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION"
case 1:
return "WORKFLOW_ALREADY_COMPLETED"
}
return fmt.Sprintf("SignalExternalWorkflowExecutionFailedCause(%d)", w)
}
Expand All @@ -5749,6 +5757,9 @@ func (e *SignalExternalWorkflowExecutionFailedCause) UnmarshalText(value []byte)
case "UNKNOWN_EXTERNAL_WORKFLOW_EXECUTION":
*e = SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution
return nil
case "WORKFLOW_ALREADY_COMPLETED":
*e = SignalExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted
return nil
default:
val, err := strconv.ParseInt(s, 10, 32)
if err != nil {
Expand All @@ -5767,6 +5778,7 @@ func (e SignalExternalWorkflowExecutionFailedCause) MarshalText() ([]byte, error
const (
// SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution is an option for SignalExternalWorkflowExecutionFailedCause
SignalExternalWorkflowExecutionFailedCauseUnknownExternalWorkflowExecution SignalExternalWorkflowExecutionFailedCause = iota
SignalExternalWorkflowExecutionFailedCauseWorkflowAlreadyCompleted
)

// SignalExternalWorkflowExecutionFailedEventAttributes is an internal type (TBD...)
Expand Down
1 change: 1 addition & 0 deletions common/types/testdata/service_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ var (
InitiatedID: EventID1,
CompletedExecution: &WorkflowExecution,
CompletionEvent: &HistoryEvent_WorkflowExecutionStarted,
StartedID: EventID2,
}
HistoryRecordDecisionTaskStartedRequest = types.RecordDecisionTaskStartedRequest{
DomainUUID: DomainID,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ require (
github.com/startreedata/pinot-client-go v0.2.0 // latest release supports pinot v0.12.0 which is also internal version
github.com/stretchr/testify v1.8.3
github.com/uber-go/tally v3.3.15+incompatible
github.com/uber/cadence-idl v0.0.0-20240326234200-e3a59cdd3c36
github.com/uber/cadence-idl v0.0.0-20240416202333-83d5cae7fc51
github.com/uber/ringpop-go v0.8.5
github.com/uber/tchannel-go v1.22.2
github.com/urfave/cli v1.22.4
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -444,8 +444,8 @@ github.com/uber-go/tally v3.3.12+incompatible/go.mod h1:YDTIBxdXyOU/sCWilKB4bgyu
github.com/uber-go/tally v3.3.15+incompatible h1:9hLSgNBP28CjIaDmAuRTq9qV+UZY+9PcvAkXO4nNMwg=
github.com/uber-go/tally v3.3.15+incompatible/go.mod h1:YDTIBxdXyOU/sCWilKB4bgyufu1cEi0jdVnRdxvjnmU=
github.com/uber/cadence-idl v0.0.0-20211111101836-d6b70b60eb8c/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
github.com/uber/cadence-idl v0.0.0-20240326234200-e3a59cdd3c36 h1:75Uvw7a4Pqo5LrpAFfJehKSJT50JcF7dQolJj5/bUc4=
github.com/uber/cadence-idl v0.0.0-20240326234200-e3a59cdd3c36/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
github.com/uber/cadence-idl v0.0.0-20240416202333-83d5cae7fc51 h1:gAdDymipzIzh7PTPAW7DjFT2BOEwY7hwC0COsZIulsI=
github.com/uber/cadence-idl v0.0.0-20240416202333-83d5cae7fc51/go.mod h1:oyUK7GCNCRHCCyWyzifSzXpVrRYVBbAMHAzF5dXiKws=
github.com/uber/jaeger-client-go v2.22.1+incompatible h1:NHcubEkVbahf9t3p75TOCR83gdUHXjRJvjoBh1yACsM=
github.com/uber/jaeger-client-go v2.22.1+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v2.2.0+incompatible h1:MxZXOiR2JuoANZ3J6DE/U0kSFv/eJ/GfSYVCjK7dyaw=
Expand Down
1 change: 1 addition & 0 deletions proto/internal/uber/cadence/history/v1/service.proto
Original file line number Diff line number Diff line change
Expand Up @@ -528,6 +528,7 @@ message RecordChildExecutionCompletedRequest {
int64 initiated_id = 3;
api.v1.WorkflowExecution completed_execution = 4;
api.v1.HistoryEvent completion_event = 5;
int64 started_id = 6;
}

message RecordChildExecutionCompletedResponse {
Expand Down
Loading

0 comments on commit 607b6d9

Please sign in to comment.