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 shard loading on t activation, speed up BQ cache loading #4977

Merged

Conversation

etiennedi
Copy link
Member

This commit combines three changes:

  1. It now forces loading of a shard when a tenant is deactivated. This happens in the background, but it is triggered immediately. Previoulsy this was delayed (by lazy shard-loading) until the actual request came in. This however defeated the purpose of activating the tenant beforehand, as it was not ready to go when the request came.

  2. If the flat index is used with BQ-caching, this commit speeds up the preloading time considerably. Previously we would dynamically grow the index as we read through the cursor. This lead to a lot of unnecessary copying. By growing just once, I could improve the startup time from 1.3s to 0.3s for a flat index with 1.25M BQ vectors

  3. In addition it is now possible to change the bq.cache setting for the flat index. Note that changes will not take effect until there is a restart/reload of the shard. This is by design to prevent 1,000s of active tenant shards from suddenly hammering disks because of a config change.

What's being changed:

Review checklist

  • Documentation has been updated, if necessary. Link to changed documentation:
  • Chaos pipeline run or not necessary. Link to pipeline:
  • All new code is covered by tests where it is reasonable.
  • Performance tests have been run or not necessary.

abdelr
abdelr previously approved these changes May 19, 2024
moogacs
moogacs previously approved these changes May 21, 2024
adapters/repos/db/migrator.go Outdated Show resolved Hide resolved
antas-marcin
antas-marcin previously approved these changes May 30, 2024
@antas-marcin antas-marcin force-pushed the turn-modify-compression-cache-on-existing-col branch from 4781a28 to 273e434 Compare May 30, 2024 14:01
This commit combines three changes:

1. It now forces loading of a shard when a tenant is deactivated. This
   happens in the background, but it is triggered immediately.
   Previoulsy this was delayed (by lazy shard-loading) until the actual
   request came in. This however defeated the purpose of activating the
   tenant beforehand, as it was not ready to go when the request came.

2. If the flat index is used with BQ-caching, this commit speeds up the
   preloading time considerably. Previously we would dynamically grow
   the index as we read through the cursor. This lead to a lot of
   unnecessary copying. By growing just once, I could improve the
   startup time from 1.3s to 0.3s for a flat index with 1.25M BQ vectors

3. In addition it is now possible to change the bq.cache setting for the
   flat index. Note that changes will not take effect until there is a
   restart/reload of the shard. This is by design to prevent 1,000s of
   active tenant shards from suddenly hammering disks because of a
   config change.
@antas-marcin antas-marcin force-pushed the turn-modify-compression-cache-on-existing-col branch from 273e434 to f358446 Compare May 30, 2024 19:35
@etiennedi etiennedi dismissed stale reviews from antas-marcin, abdelr, and moogacs via 0fbba4f June 4, 2024 16:51
Copy link

sonarcloud bot commented Jun 4, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

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

See analysis details on SonarCloud

@etiennedi etiennedi merged commit ba3b7d5 into stable/v1.25 Jun 5, 2024
42 of 43 checks passed
@etiennedi etiennedi deleted the turn-modify-compression-cache-on-existing-col branch June 5, 2024 12:16
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

4 participants