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

Fix cleaning > 10000 channels #81

Merged
merged 2 commits into from
Jul 18, 2024
Merged

Conversation

jacomago
Copy link
Contributor

Elastic/ChannelFinder has a setting ES_QUERY_SIZE. So by default queries only return up to ES_QUERY_SIZE channels, which by default is 10000.

When the clean runs it fetches using this api all channels where the pvStatus is Active. But if there are more than 10000 this won't work due to the ES_QUERY_SIZE.

Solution here is to keep setting channels to Inactive and querying for more channels until there are no channels set to Active.

@jacomago
Copy link
Contributor Author

Will do more testing next week to check this works as expected.

@jacomago jacomago force-pushed the clean-more-than-elastic-limit branch from 5eaa8fb to 1f73833 Compare April 12, 2024 14:03
Elastic/ChannelFinder has a setting ES_QUERY_SIZE. So by default queries only return up to ES_QUERY_SIZE channels, which by default is 10000.

When the clean runs it fetches using this api all channels where the pvStatus is Active. But if there are more than 10000 this won't work due to the ES_QUERY_SIZE.

Solution here is to keep setting channels to Inactive and querying for more channels until there are no channels set to Active.
@jacomago jacomago force-pushed the clean-more-than-elastic-limit branch from 1f73833 to 52f0e6b Compare May 7, 2024 10:58
Copy link

sonarqubecloud bot commented May 7, 2024

Quality Gate Passed Quality Gate passed

Issues
1 New issue
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@jacomago jacomago self-assigned this May 7, 2024
@tynanford
Copy link
Contributor

I ran into this issue and tried the PR. In most cases it seemed like 20K PVs got cleaned on shutdown out of 38K PVs. But this is using docker and docker-compose to run recceiver and that looks like the reason it doesn't fully work? Using the --timeout flag like docker compose up --timeout 600 let the clean process finish and all the PVs were marked Inactive.

Is there a reason to hard-code 10000 in the findByArgs call? I think it would be better to either have the user set findSizeLimit in their config or default to the ES limit

Copy link

@tynanford tynanford requested review from shroffk and tynanford July 17, 2024 17:03
Copy link
Contributor

@tynanford tynanford left a comment

Choose a reason for hiding this comment

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

LGTM! Added @shroffk as reviewer too

@jacomago jacomago marked this pull request as ready for review July 18, 2024 07:48
@shroffk
Copy link
Collaborator

shroffk commented Jul 18, 2024

LGTM

However, I think we should work on a better API for these kinds of operations

@shroffk shroffk merged commit 8f5a22c into master Jul 18, 2024
7 checks passed
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.

3 participants