Skip to content

Write reminders in multiple partitions#3297

Merged
dapr-bot merged 13 commits into
dapr:masterfrom
artursouza:split_reminder_db
Jul 12, 2021
Merged

Write reminders in multiple partitions#3297
dapr-bot merged 13 commits into
dapr:masterfrom
artursouza:split_reminder_db

Conversation

@artursouza

Copy link
Copy Markdown
Contributor

Description

Split actor reminders storage into multiple keys.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #2889

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

@artursouza
artursouza requested a review from berndverst June 16, 2021 06:55
@artursouza
artursouza marked this pull request as draft June 16, 2021 06:55
@codecov

codecov Bot commented Jun 16, 2021

Copy link
Copy Markdown

Codecov Report

Merging #3297 (0ad7505) into master (032f108) will increase coverage by 0.74%.
The diff coverage is 70.54%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3297      +/-   ##
==========================================
+ Coverage   58.50%   59.25%   +0.74%     
==========================================
  Files          84       96      +12     
  Lines        7611     8482     +871     
==========================================
+ Hits         4453     5026     +573     
- Misses       2848     3101     +253     
- Partials      310      355      +45     
Impacted Files Coverage Δ
cmd/placement/config.go 27.02% <ø> (ø)
cmd/placement/main.go 0.00% <ø> (ø)
pkg/components/bindings/registry.go 100.00% <ø> (ø)
pkg/components/kubernetes_loader.go 50.00% <ø> (ø)
pkg/components/middleware/http/registry.go 100.00% <ø> (ø)
pkg/components/nameresolution/registry.go 100.00% <ø> (ø)
pkg/components/pubsub/registry.go 100.00% <ø> (ø)
pkg/components/secretstores/registry.go 100.00% <ø> (ø)
pkg/components/standalone_loader.go 61.81% <ø> (ø)
pkg/credentials/certchain.go 0.00% <ø> (ø)
... and 99 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 6bb566f...0ad7505. Read the comment docs.

@berndverst berndverst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM so far.

@artursouza

Copy link
Copy Markdown
Contributor Author

LGTM so far.

There is a long way to go to make this prod ready. I still need to:

  • Enable the partition write and read path.
  • Make the partition configurable.
  • Implement partition config change strategy
  • Write E2E test with happy path.
  • Write E2E test with partition config change.

@artursouza
artursouza changed the base branch from release-1.2 to master June 21, 2021 02:50
@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@dapr-bot

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-08 for linux. Please check the build status.

@dapr-bot

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-05 for windows. Please check the build status.

@dapr-bot

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on linux. Please check the build logs

@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@dapr-bot

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-07 for linux. Please check the build status.

@dapr-bot

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-06 for windows. Please check the build status.

@dapr-bot

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on windows. Please check the build logs

@dapr-bot

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on linux. Please check the build logs

@dapr-bot

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on windows. Please check the build logs

@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-perf

@dapr-bot

dapr-bot commented Jul 6, 2021

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-08 for linux. Please check the build status.

@dapr-bot

dapr-bot commented Jul 6, 2021

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-perf-01. Please wait until test is done.

@dapr-bot

dapr-bot commented Jul 6, 2021

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-05 for windows. Please check the build status.

@dapr-bot

dapr-bot commented Jul 6, 2021

Copy link
Copy Markdown
Collaborator

Dapr Perf tests failed.

@dapr-bot

dapr-bot commented Jul 6, 2021

Copy link
Copy Markdown
Collaborator

Congrats! All end-to-end tests have passed on linux. Thanks for your contribution!

@dapr-bot

dapr-bot commented Jul 6, 2021

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on windows. Please check the build logs

@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-perf

@dapr-bot

dapr-bot commented Jul 6, 2021

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-07 for linux. Please check the build status.

@dapr-bot

dapr-bot commented Jul 6, 2021

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-perf-01. Please wait until test is done.

@dapr-bot

dapr-bot commented Jul 6, 2021

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-06 for windows. Please check the build status.

@dapr-bot

dapr-bot commented Jul 6, 2021

Copy link
Copy Markdown
Collaborator

Dapr Perf tests failed.

@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@artursouza

Copy link
Copy Markdown
Contributor Author

/ok-to-perf

@dapr-bot

dapr-bot commented Jul 9, 2021

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-08 for linux. Please check the build status.

@dapr-bot

dapr-bot commented Jul 9, 2021

Copy link
Copy Markdown
Collaborator

Found the available test cluster - dapr-aks-e2e-06 for windows. Please check the build status.

@dapr-bot

dapr-bot commented Jul 9, 2021

Copy link
Copy Markdown
Collaborator

Congrats! All end-to-end tests have passed on linux. Thanks for your contribution!

@dapr-bot

dapr-bot commented Jul 9, 2021

Copy link
Copy Markdown
Collaborator

End-to-end tests failed on windows. Please check the build logs

Comment thread pkg/actors/actors.go
@@ -831,14 +850,102 @@ func (a *actorsRuntime) getReminder(req *CreateReminderRequest) (*Reminder, bool
a.remindersLock.RUnlock()

for _, r := range reminders {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This for loop might have scaling problems in the future. Suggest considering indices for pre-filtering.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

getReminder() is used only in the CreateReminder() method. Right now, the bottleneck is more in the IO needed to retrieve all reminders for a given ActorType. After we improve throughput from the IO constraints, we will look into in-memory enhancements in this particular path.

On the other hand, I found similar loops in the code where we could improve by indexing per ActorType/ActorId/ReminderName combination.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Tracking it in #3412

halspang
halspang previously approved these changes Jul 9, 2021

@halspang halspang left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, just a nitpick.

Comment thread pkg/actors/actors.go Outdated
Comment thread pkg/actors/actors.go
Comment thread pkg/actors/actors.go
}

if actorMetadata.RemindersMetadata.PartitionCount > a.config.RemindersStoragePartitions {
log.Warnf("cannot decrease number of partitions for reminders of actor type %s", actorType)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Agreed with @artursouza.

Comment thread pkg/actors/actors.go

@yaron2 yaron2 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@artursouza artursouza added the automerge Allows DaprBot to automerge and update PR if all approvals are in place label Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

automerge Allows DaprBot to automerge and update PR if all approvals are in place

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Storage of actor reminders in one single db-field

6 participants