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

feat: move on-demand subscriber to batch service #952

Merged
merged 24 commits into from
Jun 6, 2024
Merged

Conversation

Ubisoft-potato
Copy link
Collaborator

@Ubisoft-potato Ubisoft-potato commented May 20, 2024

Part of #405

This PR will upgrade multi PubSub architecture to support on-demand subscriber:

  • event-persister-evaluation-events-dwh
  • event-persister-evaluation-events-ops
  • event-persister-goal-events-dwh
  • event-persister-goal-events-ops

Key Changes

  • Add on-demand subscriber architecture. [1] [2]
  • Manage on-demand subscriber json configuration seperately. [1] [2] [3]
  • Register on-demand subscribers. [1] [2]

Refactor event persisters

Move storage pkg

  • The persisters storage code was moved to pkg/batch/storage directory. [1] [2] [3] [4]

@Ubisoft-potato Ubisoft-potato marked this pull request as ready for review May 23, 2024 04:05
@Ubisoft-potato Ubisoft-potato changed the title feat: add serverless subscriber feat: move on-demand subscriber to batch service May 23, 2024
@@ -1,16 +1,16 @@
// Copyright 2023 The Bucketeer Authors.
// Copyright 2024 The Bucketeer Authors.
Copy link
Member

Choose a reason for hiding this comment

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

nit: It shouldn't introduce an extra space here.

bigQueryBatchSize:
timezone:
goalCountEventOPSPersister:
flushSize: 100
Copy link
Member

Choose a reason for hiding this comment

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

Please use the following default settings for all the new persisters.

    flushSize: 20
    flushInterval: 5
    flushTimeout: 30

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated.

project:
topic:
subscription:
pullerNumGoroutines: 5
Copy link
Member

Choose a reason for hiding this comment

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

Please use the following default settings for all the new persisters.

    pullerNumGoroutines: 5
    pullerMaxOutstandingMessages: 1000
    pullerMaxOutstandingBytes: 100000000
    maxMps: 100
    workerNum: 1
    checkInterval: 10

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Updated.

@@ -64,7 +74,7 @@ type Configuration struct {
WorkerNum int `json:"workerNum"`
}

type Subscriber struct {
type NormalSubscriber struct {
Copy link
Member

Choose a reason for hiding this comment

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

Let's keep the the name Subscriber.
Also, please make it private.

@@ -103,7 +103,7 @@ func getCodeFromError(err error) string {
return codeUnknown
}

func registerMetrics(r metrics.Registerer) {
func RegisterMetrics(r metrics.Registerer) {
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to make this public?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, since the events dwh persisters need to use bigquery writer, but we can't register the metrics twice, so we have to register bigquery writer metrics when the batch service starting

@@ -1,21 +1,22 @@
// Copyright 2024 The Bucketeer Authors.
// Copyright 2024 The Bucketeer Authors.
Copy link
Member

Choose a reason for hiding this comment

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

Please fix the extra space.

@@ -1,33 +1,33 @@
// Copyright 2024 The Bucketeer Authors.
// Copyright 2024 The Bucketeer Authors.
Copy link
Member

Choose a reason for hiding this comment

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

Same for the other files.

Copy link
Member

@cre8ivejp cre8ivejp left a comment

Choose a reason for hiding this comment

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

Thank you!

@cre8ivejp cre8ivejp merged commit b6c3b40 into main Jun 6, 2024
10 checks passed
@cre8ivejp cre8ivejp deleted the upgrade-pubsub-arch branch June 6, 2024 07:47
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.

2 participants