Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Pinot as new visibility option #5201

Merged
merged 88 commits into from
Oct 19, 2023
Merged

Add Pinot as new visibility option #5201

merged 88 commits into from
Oct 19, 2023

Conversation

neil-xie
Copy link
Member

@neil-xie neil-xie commented Apr 10, 2023

What changed?
Updated server start up to choose visibility manager based on the advanced visibility option
Added new triple visibility manager to provide options to write to both ES and Pinot for future migration
Added pinotVisibilityStore and pinotClient to support storing visibility messages in Pinot
Added util methods to flatten the search attributes into columns
Added util methods to validate pinot response and query
Added new kafka indexer message type for Pinot since Pinot doesn't need indexer to process
Added integration test to set up Pinot test cluster and test Pinot functionality
image

Why?
ElasticSearch is going to be deprecated with Uber, we will migrate from ElasticSearch to Pinot. This is the first step to make Cadence work with Pinot as the advanced visibility store. In the future, we will add support for more components like migration between ES and Pinot.

How did you test it?
Added unit test for Pinot visibility store and pinot client.
Added unit test for Pinot response comparator
Added integration test for Pinot to test the functionality
Bench test in staging environment to test performance.

Potential risks
Pinot doesn't support deletion yet, the storage may continue growing without segment compaction.
We have the pinot/es response comparator to help detect data issue during migration

Release notes

Documentation Changes

@neil-xie neil-xie changed the title Add Pinot as visibility store Add Pinot as new visibility option Apr 10, 2023
@coveralls
Copy link

coveralls commented Apr 11, 2023

Pull Request Test Coverage Report for Build 01889c7f-de68-4a99-b008-2857a41a2cf5

  • 512 of 1595 (32.1%) changed or added relevant lines in 15 files are covered.
  • 127 unchanged lines in 10 files lost coverage.
  • Overall coverage decreased (-0.3%) to 56.999%

Changes Missing Coverage Covered Lines Changed/Added Lines %
common/messaging/kafka/producerImpl.go 0 7 0.0%
host/onebox.go 8 19 42.11%
common/pinot/page_token.go 18 31 58.06%
common/pinot/responseUtility.go 48 62 77.42%
cmd/server/cadence/server.go 0 29 0.0%
common/persistence/client/factory.go 3 38 7.89%
host/integrationbase.go 0 39 0.0%
common/pinot/pinotClient.go 54 98 55.1%
host/testcluster.go 0 59 0.0%
common/persistence/pinotiVsibilityDualManager.go 0 189 0.0%
Files with Coverage Reduction New Missed Lines %
common/task/weightedRoundRobinTaskScheduler.go 2 89.64%
common/persistence/nosql/nosqlplugin/cassandra/workflow.go 3 59.55%
common/persistence/statsComputer.go 3 94.64%
service/history/task/transfer_standby_task_executor.go 4 86.51%
common/persistence/serialization/parser.go 8 63.91%
common/persistence/serialization/thrift_decoder.go 8 57.14%
common/persistence/nosql/nosqlplugin/cassandra/workflowParsingUtils.go 14 83.3%
service/history/execution/mutable_state_task_refresher.go 22 66.46%
common/persistence/sql/workflowStateMaps.go 23 82.97%
common/persistence/serialization/getters.go 40 58.59%
Totals Coverage Status
Change from base Build 01888ddc-c0cb-401c-8336-3a6dc30fc0b9: -0.3%
Covered Lines: 87530
Relevant Lines: 153564

💛 - Coveralls

@neil-xie neil-xie requested a review from a team August 24, 2023 00:28
neil-xie and others added 3 commits September 28, 2023 12:52
* enable json index, change the quries for exact/partial match, update the unit tests

* make it pass integration test: found that order by is not supported in json index column

* update partial match query. It didn't work in the mono repo

* Implemented deletion method for Pinot visibility store (#5404)
#5411)

* Add pinot metrics client and update pinot visibility manager to use it
cmd/server/cadence/server.go Outdated Show resolved Hide resolved
common/persistence/Pinot/pinotVisibilityMetricClients.go Outdated Show resolved Hide resolved
common/persistence/Pinot/pinotVisibilityMetricClients.go Outdated Show resolved Hide resolved
common/persistence/Pinot/pinotVisibilityStore.go Outdated Show resolved Hide resolved
common/persistence/Pinot/pinotVisibilityStore.go Outdated Show resolved Hide resolved
common/persistence/Pinot/pinotVisibilityStore.go Outdated Show resolved Hide resolved
common/pinot/pinotQueryValidator.go Show resolved Hide resolved
common/persistence/Pinot/pinotVisibilityStore.go Outdated Show resolved Hide resolved
common/pinot/pinotQueryValidator_test.go Show resolved Hide resolved
common/pinot/responseUtility.go Outdated Show resolved Hide resolved
common/pinot/responseUtility.go Outdated Show resolved Hide resolved
common/constants.go Outdated Show resolved Hide resolved
go.mod Outdated Show resolved Hide resolved
@neil-xie neil-xie merged commit eb8eea9 into master Oct 19, 2023
@neil-xie neil-xie deleted the CDNC_4431 branch October 19, 2023 20:37
Copy link
Contributor

@3vilhamster 3vilhamster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some nit comments from looking at this file later on. Might be worth improving


// ValidateQuery validates that search attributes in the query and returns modified query.
func (qv *VisibilityQueryValidator) ValidateQuery(whereClause string) (string, error) {
if len(whereClause) != 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: use short return.

if len(whereClause) == 0 {
   return whereClause, nil
}

that will make this function easier to read.

}

func (qv *VisibilityQueryValidator) processSystemKey(expr sqlparser.Expr) (string, error) {
comparisonExpr := expr.(*sqlparser.ComparisonExpr)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: for all methods that expect a single type, it would be easier to use it directly instead of asserting to the interface.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants