Skip to content

Commit

Permalink
IWF-249: Remove optimize versioning (#484)
Browse files Browse the repository at this point in the history
  • Loading branch information
longquanzheng authored Nov 19, 2024
1 parent cb0d67c commit 95bd316
Show file tree
Hide file tree
Showing 24 changed files with 4,412 additions and 1,047 deletions.
4 changes: 2 additions & 2 deletions cmd/server/iwf/iwf.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ package iwf
import (
"fmt"
"github.com/indeedeng/iwf/config"
cadenceapi "github.com/indeedeng/iwf/service/client/cadence"
temporalapi "github.com/indeedeng/iwf/service/client/temporal"
rawLog "log"
"strings"
"sync"
"time"

isvc "github.com/indeedeng/iwf/service"
"github.com/indeedeng/iwf/service/api"
cadenceapi "github.com/indeedeng/iwf/service/api/cadence"
temporalapi "github.com/indeedeng/iwf/service/api/temporal"
uclient "github.com/indeedeng/iwf/service/client"
"github.com/indeedeng/iwf/service/common/log"
"github.com/indeedeng/iwf/service/common/log/loggerimpl"
Expand Down
2 changes: 0 additions & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,6 @@ type (
// Port is the port on which the API service will bind to
Port int `yaml:"port"`
MaxWaitSeconds int64 `yaml:"maxWaitSeconds"`
// OptimizedVersioning is the versioning optimization flag
OptimizedVersioning *bool `yaml:"optimizedVersioning"`
// omitRpcInputOutputInHistory is the flag to omit rpc input/output in history
// the input/output is only for debugging purpose but could be too expensive to store
OmitRpcInputOutputInHistory *bool `yaml:"omitRpcInputOutputInHistory"`
Expand Down
5 changes: 2 additions & 3 deletions integ/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ const testIwfServerPort = "9715"
func createTestConfig(testCfg IwfServiceTestConfig) config.Config {
return config.Config{
Api: config.ApiConfig{
Port: 9715,
MaxWaitSeconds: 10, // use 10 so that we can test it in the waiting test
OptimizedVersioning: testCfg.OptimizedVersioning,
Port: 9715,
MaxWaitSeconds: 10, // use 10 so that we can test it in the waiting test
WaitForStateCompletionMigration: config.WaitForStateCompletionMigration{
SignalWithStartOn: "old",
WaitForOn: "old",
Expand Down
1 change: 0 additions & 1 deletion integ/locking_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ func doTestLockingWorkflow(t *testing.T, backendType service.BackendType, config
_, closeFunc2 := startIwfServiceByConfig(IwfServiceTestConfig{
BackendType: backendType,
DisableFailAtMemoIncompatibility: true,
OptimizedVersioning: ptr.Any(true),
})
defer closeFunc2()

Expand Down
10 changes: 6 additions & 4 deletions integ/persistence_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,8 @@ func doTestPersistenceWorkflow(
defer closeFunc1()

uclient, closeFunc2 := startIwfServiceByConfig(IwfServiceTestConfig{
BackendType: backendType,
MemoEncryption: memoEncryption,
OptimizedVersioning: ptr.Any(true),
BackendType: backendType,
MemoEncryption: memoEncryption,
})
defer closeFunc2()

Expand Down Expand Up @@ -402,7 +401,10 @@ func doTestPersistenceWorkflow(
}
}

func getDataAttributes(initReqQry iwfidl.ApiApiV1WorkflowDataobjectsGetPostRequest, wfId string, expectedDataAttribute iwfidl.KeyValue, useMemo bool) (*iwfidl.WorkflowGetDataObjectsResponse, *http.Response, error) {
func getDataAttributes(
initReqQry iwfidl.ApiApiV1WorkflowDataobjectsGetPostRequest, wfId string, expectedDataAttribute iwfidl.KeyValue,
useMemo bool,
) (*iwfidl.WorkflowGetDataObjectsResponse, *http.Response, error) {
return initReqQry.WorkflowGetDataObjectsRequest(iwfidl.WorkflowGetDataObjectsRequest{
WorkflowId: wfId,
Keys: []string{
Expand Down
3 changes: 1 addition & 2 deletions integ/start_delay_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ func doTestStartDelay(t *testing.T, backendType service.BackendType, config *iwf
defer closeFunc1()

_, closeFunc2 := startIwfServiceByConfig(IwfServiceTestConfig{
BackendType: backendType,
OptimizedVersioning: ptr.Any(false),
BackendType: backendType,
})
defer closeFunc2()

Expand Down
5 changes: 2 additions & 3 deletions integ/util.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package integ

import (
cadenceapi "github.com/indeedeng/iwf/service/client/cadence"
temporalapi "github.com/indeedeng/iwf/service/client/temporal"
"log"
"net/http"
"time"
Expand All @@ -11,8 +13,6 @@ import (
"github.com/indeedeng/iwf/integ/workflow/common"
"github.com/indeedeng/iwf/service"
"github.com/indeedeng/iwf/service/api"
cadenceapi "github.com/indeedeng/iwf/service/api/cadence"
temporalapi "github.com/indeedeng/iwf/service/api/temporal"
uclient "github.com/indeedeng/iwf/service/client"
"github.com/indeedeng/iwf/service/common/log/loggerimpl"
"github.com/indeedeng/iwf/service/interpreter/cadence"
Expand Down Expand Up @@ -66,7 +66,6 @@ type IwfServiceTestConfig struct {
BackendType service.BackendType
MemoEncryption bool
DisableFailAtMemoIncompatibility bool // default to false so that we will fail at test
OptimizedVersioning *bool
DefaultHeaders map[string]string
}

Expand Down
41 changes: 20 additions & 21 deletions integ/wait_until_search_attributes_optimization_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,7 @@ func doTestWaitUntilHistoryCompleted(
defer closeFunc1()

uclient, closeFunc2 := startIwfServiceByConfig(IwfServiceTestConfig{
BackendType: backendType,
OptimizedVersioning: ptr.Any(true),
BackendType: backendType,
})
defer closeFunc2()

Expand Down Expand Up @@ -131,28 +130,28 @@ func doTestWaitUntilHistoryCompleted(

switch mode := config.GetExecutingStateIdMode(); mode {
case iwfidl.ENABLED_FOR_ALL:
assertions.Equal(9, len(upsertSAEvents))
assertions.Equal([]string{"S1"}, historyEventSAs(upsertSAEvents[0]))
assertions.Equal([]string{"S2"}, historyEventSAs(upsertSAEvents[1]))
assertions.Equal([]string{"S2", "S3"}, historyEventSAs(upsertSAEvents[2]))
assertions.Equal([]string{"S3", "S4"}, historyEventSAs(upsertSAEvents[3]))
assertions.Equal([]string{"S3", "S5"}, historyEventSAs(upsertSAEvents[4]))
assertions.Equal([]string{"S3", "S6", "S7"}, historyEventSAs(upsertSAEvents[5]))
assertions.Equal([]string{"S3", "S6"}, historyEventSAs(upsertSAEvents[6]))
assertions.Equal([]string{"S3"}, historyEventSAs(upsertSAEvents[7]))
assertions.Equal([]string{"null"}, historyEventSAs(upsertSAEvents[8]))
assertions.Equal(11, len(upsertSAEvents))
assertions.Equal([]string{"S1"}, historyEventSAs(upsertSAEvents[2]))
assertions.Equal([]string{"S2"}, historyEventSAs(upsertSAEvents[3]))
assertions.Equal([]string{"S2", "S3"}, historyEventSAs(upsertSAEvents[4]))
assertions.Equal([]string{"S3", "S4"}, historyEventSAs(upsertSAEvents[5]))
assertions.Equal([]string{"S3", "S5"}, historyEventSAs(upsertSAEvents[6]))
assertions.Equal([]string{"S3", "S6", "S7"}, historyEventSAs(upsertSAEvents[7]))
assertions.Equal([]string{"S3", "S6"}, historyEventSAs(upsertSAEvents[8]))
assertions.Equal([]string{"S3"}, historyEventSAs(upsertSAEvents[9]))
assertions.Equal([]string{"null"}, historyEventSAs(upsertSAEvents[10]))
case iwfidl.ENABLED_FOR_STATES_WITH_WAIT_UNTIL:
assertions.Equal(8, len(upsertSAEvents))
assertions.Equal([]string{"S1"}, historyEventSAs(upsertSAEvents[0]))
assertions.Equal([]string{"S2"}, historyEventSAs(upsertSAEvents[1]))
assertions.Equal([]string{"S2", "S3"}, historyEventSAs(upsertSAEvents[2]))
assertions.Equal([]string{"S3", "S4"}, historyEventSAs(upsertSAEvents[3]))
assertions.Equal([]string{"S3"}, historyEventSAs(upsertSAEvents[4]))
assertions.Equal([]string{"S3", "S6"}, historyEventSAs(upsertSAEvents[5]))
assertions.Equal(10, len(upsertSAEvents))
assertions.Equal([]string{"S1"}, historyEventSAs(upsertSAEvents[2]))
assertions.Equal([]string{"S2"}, historyEventSAs(upsertSAEvents[3]))
assertions.Equal([]string{"S2", "S3"}, historyEventSAs(upsertSAEvents[4]))
assertions.Equal([]string{"S3", "S4"}, historyEventSAs(upsertSAEvents[5]))
assertions.Equal([]string{"S3"}, historyEventSAs(upsertSAEvents[6]))
assertions.Equal([]string{"null"}, historyEventSAs(upsertSAEvents[7]))
assertions.Equal([]string{"S3", "S6"}, historyEventSAs(upsertSAEvents[7]))
assertions.Equal([]string{"S3"}, historyEventSAs(upsertSAEvents[8]))
assertions.Equal([]string{"null"}, historyEventSAs(upsertSAEvents[9]))
case iwfidl.DISABLED:
assertions.Equal(0, len(upsertSAEvents))
assertions.Equal(2, len(upsertSAEvents))
}
}

Expand Down
3 changes: 1 addition & 2 deletions integ/wait_until_search_attributes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ func doTestWaitUntilSearchAttributes(
defer closeFunc1()

_, closeFunc2 := startIwfServiceByConfig(IwfServiceTestConfig{
BackendType: backendType,
OptimizedVersioning: ptr.Any(true),
BackendType: backendType,
})
defer closeFunc2()

Expand Down
Loading

0 comments on commit 95bd316

Please sign in to comment.