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

dynamic delay: fix pending bytes rate calculation #451

Merged
merged 1 commit into from
Apr 2, 2023

Conversation

Yuval-Ariel
Copy link
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 self-assigned this Mar 26, 2023
}
uint64_t step_size = ceil(soft_hard_range / kNumPendingSteps);
uint64_t extra_bytes = compaction_needed_bytes - soft_limit;
assert(extra_bytes > 0);
Copy link
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
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
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
Contributor Author

@RoyBenMoshe one last time (hopefully)

@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