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: Enhance Initial Request Target Selection #78

Merged
merged 1 commit into from
Aug 21, 2023

Conversation

avasani
Copy link
Contributor

@avasani avasani commented Aug 18, 2023

What it Does

This update refines the logic for selecting the initial request target within the BoltRouter module, while expanding its capabilities. By incorporating support for both random and object hash-based traffic distribution, we optimize routing decisions to align with specific use cases.

Previously, the selection process relied solely on the Random Crunch Traffic Split strategy, which could lead to data inconsistencies when handling mixed GET and PUT requests.

With this enhancement, the SelectInitialRequestTarget function now considers the CrunchTrafficSplit configuration parameter. This parameter accepts two values: "CrunchTrafficSplitByRandomRequest" and "CrunchTrafficSplitByObjectKeyHash". When set to "CrunchTrafficSplitByRandomRequest", the routing process continues
as before, distributing traffic randomly. On the other hand, when set to "CrunchTrafficSplitByObjectKeyHash", the routing decision is made based on the crc32 hash value of the request's object key. By using CRC32 checksum for hash calculation, we achieve faster processing and lower memory consumption compared to MD5 or SHA-256.

Unit Test

  • Verified unit tests passing locally
  • Verify code coverage: before 68.4%, after 69%

@avasani avasani force-pushed the avasani/improve-request-splitting branch 10 times, most recently from 3ed0b7f to 91a7cfd Compare August 21, 2023 20:31
@avasani avasani changed the title feat: Improve Initial Request Target Selection feat: Enhance Initial Request Target Selection Aug 21, 2023
@avasani avasani force-pushed the avasani/improve-request-splitting branch from 91a7cfd to 9a11e7d Compare August 21, 2023 21:23
@avasani avasani force-pushed the avasani/improve-request-splitting branch from 9a11e7d to 4ef7b27 Compare August 21, 2023 22:12
This update enhances the efficiency of initial request target selection in the BoltRouter module. By using CRC32 checksum for hash calculation, we achieve faster processing and lower memory consumption compared to MD5 or SHA-256.

This change simplifies the selection process while maintaining the desired traffic distribution. The `SelectInitialRequestTarget` function now takes the `boltUrl` parameter, allowing us to base routing decisions on specific URLs. This ensures accurate distribution between "bolt" and "s3" servers.

Signed-off-by: Ashwin Vasani <ashwin.vasani@granica.ai>
@avasani avasani force-pushed the avasani/improve-request-splitting branch from 4ef7b27 to 38373ec Compare August 21, 2023 22:34
@avasani avasani merged commit dbbe3c4 into main Aug 21, 2023
7 checks passed
@avasani avasani deleted the avasani/improve-request-splitting branch August 21, 2023 22:38
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.

None yet

2 participants