Skip to content

Conversation

@jiekun
Copy link
Member

@jiekun jiekun commented Sep 26, 2025

Describe Your Changes

Expose GetTenants function in logstorage. It provides a way to get the tenants by time range for projects who use logstorage, such as VictoriaTraces.

The implementation is stolen from #417. Only HTTP API related codes are excluded. The HTTP API could be decided in #417 later without blocking this one.

The CHANGELOG was intentionally left blank, as this feature is not exposed to users.

Checklist

The following checks are mandatory:

… GetTenantIDs in storage_search.go; Renamed some variables.
@jiekun
Copy link
Member Author

jiekun commented Sep 26, 2025

Thanks for the valuable review comments. They're addressed in a273ad4, with an extra unit test for the new function in storage_search.go. PTAL again.

@jiekun jiekun requested a review from valyala September 26, 2025 11:44
@jiekun
Copy link
Member Author

jiekun commented Sep 26, 2025

@dmitryk-dk I'll rebase your branch once this pull request is merged, since there're a lot of changes by review suggestions already.

@jiekun
Copy link
Member Author

jiekun commented Sep 27, 2025

Thanks again. The review comments are addressed in f3f2a4b.

PTAL again.

In the mean time, I noticed variable name wgWorkers and wgWorkers.Done() without defer are also used in

var wgWorkers sync.WaitGroup

Let me know if you want it to be renamed to wg and move the wgWorkers.Done() to defer in a different pull request, or together with this pull request.

@jiekun jiekun requested a review from valyala September 27, 2025 12:57
@valyala valyala merged commit 43c1e66 into master Oct 1, 2025
8 checks passed
@valyala valyala deleted the feature/get-tenants branch October 1, 2025 11:58
@valyala
Copy link
Contributor

valyala commented Oct 1, 2025

Thanks again. The review comments are addressed in f3f2a4b.

PTAL again.

In the mean time, I noticed variable name wgWorkers and wgWorkers.Done() without defer are also used in

var wgWorkers sync.WaitGroup

Let me know if you want it to be renamed to wg and move the wgWorkers.Done() to defer in a different pull request, or together with this pull request.

This should be fixed for the sake of consistency. Please fix this in a separate pull request.

@valyala
Copy link
Contributor

valyala commented Oct 1, 2025

@jiekun , thank you for the pull request!

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.

2 participants