Skip to content

dynamic delay: fix pending bytes rate calculation - #451

Merged
Yuval-Ariel merged 1 commit into
mainfrom
dynamic-delay-fix-pending-bytes-calc
Apr 2, 2023
Merged

dynamic delay: fix pending bytes rate calculation#451
Yuval-Ariel merged 1 commit into
mainfrom
dynamic-delay-fix-pending-bytes-calc

Conversation

@Yuval-Ariel

Copy link
Copy Markdown
Contributor

closes #431
use fixed num delay steps instead of fixing the step size and deducing the num steps.
this makes the code simpler and avoids a bug when the excess bytes are greater than num_steps * step_size which then fails the assert: assert(step_num < num_steps); - since step_num == num_steps.

@Yuval-Ariel Yuval-Ariel added the bug fix Fixes a known bug label Mar 26, 2023
@Yuval-Ariel
Yuval-Ariel requested a review from RoyBenMoshe March 26, 2023 14:13
@Yuval-Ariel Yuval-Ariel self-assigned this Mar 26, 2023
Comment thread db/column_family.cc Outdated
}
uint64_t step_size = ceil(soft_hard_range / kNumPendingSteps);
uint64_t extra_bytes = compaction_needed_bytes - soft_limit;
assert(extra_bytes > 0);

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.

I think this condition is always true

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.

you're right, useless assert indeed. i'll remove it

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.

removed. plz reapprove @RoyBenMoshe

RoyBenMoshe
RoyBenMoshe previously approved these changes Mar 30, 2023
RoyBenMoshe
RoyBenMoshe previously approved these changes Mar 30, 2023
use fixed num delay steps instead of fixing the step size and deducing
the num steps.
this makes the code simpler and avoids a bug when the excess bytes are
greater than num_steps * step_size which then fails the assert:
assert(step_num < num_steps);  - since step_num == num_steps.
@Yuval-Ariel
Yuval-Ariel force-pushed the dynamic-delay-fix-pending-bytes-calc branch from 01dc130 to af39610 Compare March 30, 2023 09:21
@Yuval-Ariel

Copy link
Copy Markdown
Contributor Author

@RoyBenMoshe one last time (hopefully)

@Yuval-Ariel

Copy link
Copy Markdown
Contributor Author

@Yuval-Ariel
Yuval-Ariel merged commit e1fa41e into main Apr 2, 2023
Yuval-Ariel added a commit that referenced this pull request May 2, 2023
use fixed num delay steps instead of fixing the step size and deducing
the num steps.
this makes the code simpler and avoids a bug when the excess bytes are
greater than num_steps * step_size which then fails the assert:
assert(step_num < num_steps);  - since step_num == num_steps.
Yuval-Ariel added a commit that referenced this pull request May 4, 2023
use fixed num delay steps instead of fixing the step size and deducing
the num steps.
this makes the code simpler and avoids a bug when the excess bytes are
greater than num_steps * step_size which then fails the assert:
assert(step_num < num_steps);  - since step_num == num_steps.
@Yuval-Ariel
Yuval-Ariel deleted the dynamic-delay-fix-pending-bytes-calc branch May 11, 2023 08:23
udi-speedb pushed a commit that referenced this pull request Nov 13, 2023
use fixed num delay steps instead of fixing the step size and deducing
the num steps.
this makes the code simpler and avoids a bug when the excess bytes are
greater than num_steps * step_size which then fails the assert:
assert(step_num < num_steps);  - since step_num == num_steps.
udi-speedb pushed a commit that referenced this pull request Nov 15, 2023
use fixed num delay steps instead of fixing the step size and deducing
the num steps.
this makes the code simpler and avoids a bug when the excess bytes are
greater than num_steps * step_size which then fails the assert:
assert(step_num < num_steps);  - since step_num == num_steps.
udi-speedb pushed a commit that referenced this pull request Dec 4, 2023
use fixed num delay steps instead of fixing the step size and deducing
the num steps.
this makes the code simpler and avoids a bug when the excess bytes are
greater than num_steps * step_size which then fails the assert:
assert(step_num < num_steps);  - since step_num == num_steps.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug fix Fixes a known bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dynamic delay: fix calculation when range is small

2 participants