Skip to content

exporter/awss3exporter: Update uniqueKey generation to use lowercase alphanumeric characters #39269

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

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

baskenshiro
Copy link

@baskenshiro baskenshiro commented Apr 8, 2025

Description

Summary

This update enhances the uniqueKey() method in PartitionKeyBuilder by replacing the previous numeric-based key generation with a more robust alphanumeric format that includes both uppercase and lowercase letters.

Key Changes
Key Generation Logic Updated
  • Old: 9-digit numeric string (range: 100000000999999999)
  • New: 9-character alphanumeric string:
    • 1st character: letter (a–z, A–Z)
    • 2nd–9th characters: letter or digit (a–z, A–Z, 0–9)
Constants Introduced
  • letters: allowed lowercase and uppercase alphabet characters (a–z, A–Z)
  • digits: allowed numeric characters (0–9)
  • length: total length of the generated key (9)
Referring to this, the processing speed is also taken into account.

https://stackoverflow.com/questions/22892120/how-to-generate-a-random-string-of-a-fixed-length-in-go/22892986#22892986

Link to tracking issue

N/A

Testing

  • Updated existing tests to verify lowercase alphanumeric pattern
  • Added specific regex checks for:
    • First character being lowercase letter
    • Full string matching lowercase alphanumeric pattern
    • Maintaining 9 character length
  • Ran 500 iterations to verify uniqueness and pattern compliance

Documentation

No documentation changes required as this is an internal implementation detail that
doesn't affect the public API or configuration.

@baskenshiro baskenshiro requested review from atoulme and a team as code owners April 8, 2025 22:04
Copy link

linux-foundation-easycla bot commented Apr 8, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.


// This follows the original "uniqueness" algorithm
// This follows the original "uniqueness" algorithm
Copy link
Contributor

Choose a reason for hiding this comment

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

does it still follow the original uniqueness algorithm?

Copy link
Author

Choose a reason for hiding this comment

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

I removed the existing comments since I'm not sure about the "original "uniqueness" algorithm".

Copy link
Contributor

Choose a reason for hiding this comment

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

me neither. Thanks for removing it.

@atoulme atoulme marked this pull request as draft April 14, 2025 00:20
@atoulme
Copy link
Contributor

atoulme commented Apr 14, 2025

moving to draft ; please fix the compilation issues and mark ready for review again.

Copy link
Contributor

This PR was marked stale due to lack of activity. It will be closed in 14 days.

@github-actions github-actions bot added the Stale label Apr 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants