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

Minimize race in PSSM to optimize shard sync calls #1088

Merged
merged 2 commits into from
Apr 12, 2023

Conversation

chenylee-aws
Copy link
Contributor

@chenylee-aws chenylee-aws commented Apr 10, 2023

Description of changes:
There exists a race condition between PeriodicShardSyncManager (PSSM) and Scheduler as reads and writes can happen concurrently in the respective threads. This would cause unnecessary shard syncs for example when PSSM is initiated at the same time as the Scheduler the streamToLease map is filtered based on the previous snapshot of the currentStreamConfigMap which tricks the PSSM into believing that there is no leases for the newly added streams that already have leases.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@stair-aws stair-aws added the v2.x Issues related to the 2.x version label Apr 10, 2023
furq-aws
furq-aws previously approved these changes Apr 10, 2023
@chenylee-aws chenylee-aws requested a review from stair-aws April 10, 2023 23:42
stair-aws
stair-aws previously approved these changes Apr 11, 2023
Copy link
Contributor

@stair-aws stair-aws left a comment

Choose a reason for hiding this comment

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

Bias-for-action approve since this is better than what-is. Please consider the comment for a potentially even-better solution.

@chenylee-aws chenylee-aws dismissed stale reviews from stair-aws and furq-aws via c8ca395 April 11, 2023 20:58
@chenylee-aws chenylee-aws changed the title Copy streamConfigMap to avoid data race with Scheduler Minimize race in PSSM to avoid unnecessary shard sync calls Apr 12, 2023
@chenylee-aws chenylee-aws merged commit 7b23ae9 into awslabs:master Apr 12, 2023
@chenylee-aws chenylee-aws deleted the shardsync2 branch April 12, 2023 17:33
@chenylee-aws chenylee-aws changed the title Minimize race in PSSM to avoid unnecessary shard sync calls Minimize race in PSSM to optimize shard sync calls Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v2.x Issues related to the 2.x version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants