From f4bd9f178c29b86e7ca01ad0d8e6272c3044fabb Mon Sep 17 00:00:00 2001 From: Manu Srivastava Date: Tue, 15 Sep 2020 14:05:32 -0700 Subject: [PATCH] initial checkin --- .../cassandra/cassandraVisibilityPersistence.go | 7 ++----- .../persistence-tests/visibilityPersistenceTest.go | 5 ++++- common/persistence/sql/sqlVisibilityStore.go | 7 ++----- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/common/persistence/cassandra/cassandraVisibilityPersistence.go b/common/persistence/cassandra/cassandraVisibilityPersistence.go index 843ad74c05c..5056d8f25d6 100644 --- a/common/persistence/cassandra/cassandraVisibilityPersistence.go +++ b/common/persistence/cassandra/cassandraVisibilityPersistence.go @@ -287,11 +287,8 @@ func (v *cassandraVisibilityPersistence) RecordWorkflowExecutionClosed( } func (v *cassandraVisibilityPersistence) UpsertWorkflowExecution( - request *p.InternalUpsertWorkflowExecutionRequest) error { - if p.IsNopUpsertWorkflowRequest(request) { - return nil - } - return p.NewOperationNotSupportErrorForVis() + _ *p.InternalUpsertWorkflowExecutionRequest) error { + return nil } func (v *cassandraVisibilityPersistence) ListOpenWorkflowExecutions( diff --git a/common/persistence/persistence-tests/visibilityPersistenceTest.go b/common/persistence/persistence-tests/visibilityPersistenceTest.go index 7c3bc391fb0..bb4517f6a47 100644 --- a/common/persistence/persistence-tests/visibilityPersistenceTest.go +++ b/common/persistence/persistence-tests/visibilityPersistenceTest.go @@ -714,7 +714,10 @@ func (s *VisibilityPersistenceSuite) TestUpsertWorkflowExecution() { Memo: nil, SearchAttributes: nil, }, - expected: p.NewOperationNotSupportErrorForVis(), + // To avoid blocking the task queue processors on non-ElasticSearch visibility stores + // we simply treat any attempts to perform Upserts as "no-ops" + // Attempts to Scan, Count or List will still fail for non-ES stores. + expected: nil, }, } diff --git a/common/persistence/sql/sqlVisibilityStore.go b/common/persistence/sql/sqlVisibilityStore.go index 0635a10a55a..ba900938acd 100644 --- a/common/persistence/sql/sqlVisibilityStore.go +++ b/common/persistence/sql/sqlVisibilityStore.go @@ -108,11 +108,8 @@ func (s *sqlVisibilityStore) RecordWorkflowExecutionClosed(request *p.InternalRe return nil } -func (s *sqlVisibilityStore) UpsertWorkflowExecution(request *p.InternalUpsertWorkflowExecutionRequest) error { - if p.IsNopUpsertWorkflowRequest(request) { - return nil - } - return p.NewOperationNotSupportErrorForVis() +func (s *sqlVisibilityStore) UpsertWorkflowExecution(_ *p.InternalUpsertWorkflowExecutionRequest) error { + return nil } func (s *sqlVisibilityStore) ListOpenWorkflowExecutions(request *p.ListWorkflowExecutionsRequest) (*p.InternalListWorkflowExecutionsResponse, error) {