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(storagenode): add an upper limit of log stream replicas count in a storage node #294

Merged
merged 1 commit into from
Dec 28, 2022

Conversation

ijsong
Copy link
Member

@ijsong ijsong commented Dec 22, 2022

What this PR does

This patch adds a new CLI flag, --max-logstream-replicas-count, which limits the number of log
stream replicas in a storage node. The default value is -1, meaning no upper limit, and a storage
node cannot create a log stream replica if it is zero.

A storage node keeps a count variable for the number of log stream replicas. Whenever the storage
node creates a new replica, it checks if the number of log stream replicas exceeds the upper limit.
If there is no problem, the storage node creates a new replica and increases the count variable.
Conversely, the storage node decreases the count variable whenever a log stream replica is removed.

This approach has a limitation: it cannot distinguish between standard and garbage replicas.
Fundamentally, a storage node has no method to distinguish them. So, this PR won't consider that.

Which issue(s) this PR resolves

Resolves #293

@ijsong ijsong self-assigned this Dec 22, 2022
@ijsong ijsong marked this pull request as ready for review December 22, 2022 08:53
@ijsong ijsong requested a review from hungryjang as a code owner December 22, 2022 08:53
… a storage node

This patch adds a new CLI flag, `--max-logstream-replicas-count,` which limits the number of log
stream replicas in a storage node. The default value is -1, meaning no upper limit, and a storage
node cannot create a log stream replica if it is zero.

A storage node keeps a count variable for the number of log stream replicas. Whenever the storage
node creates a new replica, it checks if the number of log stream replicas exceeds the upper limit.
If there is no problem, the storage node creates a new replica and increases the count variable.
Conversely, the storage node decreases the count variable whenever a log stream replica is removed.

This approach has a limitation: it cannot distinguish between standard and garbage replicas.
Fundamentally, a storage node has no method to distinguish them. So, this PR won't consider that.

Resolves kakao#293
@ijsong ijsong merged commit 6b8414b into kakao:main Dec 28, 2022
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.

storagenode: upper limit for the number of log stream replicas in a storage node
2 participants