Skip to content

refactor: introduce thread safe shard metadata#791

Merged
mattisonchao merged 11 commits intomainfrom
refactor/shard-metadata
Oct 25, 2025
Merged

refactor: introduce thread safe shard metadata#791
mattisonchao merged 11 commits intomainfrom
refactor/shard-metadata

Conversation

@mattisonchao
Copy link
Copy Markdown
Member

Motivation

This PR introduces a thread-safe metadata structure to hide the locks behind operations. It also changes the way election pipeline metadata is accessed to use mutable clone metadata to avoid touching the metadata structure with a lock.

@mattisonchao mattisonchao marked this pull request as draft October 25, 2025 05:00
@mattisonchao mattisonchao self-assigned this Oct 25, 2025
@mattisonchao
Copy link
Copy Markdown
Member Author

rely on #788

@mattisonchao mattisonchao force-pushed the refactor/shard-metadata branch from 5c1787c to 35b0ea7 Compare October 25, 2025 05:39
Signed-off-by: mattisonchao <mattisonchao@gmail.com>
Signed-off-by: mattisonchao <mattisonchao@gmail.com>
Signed-off-by: mattisonchao <mattisonchao@gmail.com>
@mattisonchao mattisonchao marked this pull request as ready for review October 25, 2025 05:53
DefaultPeriodicTasksInterval = 1 * time.Minute
)

// --------------------------- Metadata -----------------------------
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe move to a separate file? Also, maybe use an interface

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

moved to a separate file.

Also, maybe use an interface

It's only the shard controller memory metadata. We don't need to give it an interface so far. We could add it when we really need it. :)

Signed-off-by: mattisonchao <mattisonchao@gmail.com>
@mattisonchao mattisonchao merged commit 676d273 into main Oct 25, 2025
8 checks passed
@mattisonchao mattisonchao deleted the refactor/shard-metadata branch October 25, 2025 15:08
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