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 NooBaa usagereports and endpointgroupreports collections #7554

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

tangledbytes
Copy link
Member

Explain the changes

This PR:

  1. Adds cleanup for endpointgroupreports.
  2. Fixes invalid endpointgroupreports data being stored in the tables which was slowing down the queries.
  3. Fixes the outdated indexes. NOTE: Even after trying quite a bit, I cannot get PG to reliably use the index. Sometimes it does, sometime it does not.
  • Doc added/updated
  • Tests added

Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
Signed-off-by: Utkarsh Srivastava <srivastavautkarsh8097@gmail.com>
@tangledbytes
Copy link
Member Author

NOTE: I have split the PR into multiple commits as I am not sure what can we backport and what we cannot. Somethings are crucial for backporting IMO like cleanups and fixing the invalid data being stored in the table.
Indexes can be skipped because they affect the performance, not the correctness.

@dannyzaken
Copy link
Contributor

I don't have any comments from a technical perspective.

In general, I really don't like the way we handle and store stats. Some of the stats we store are never even used anymore (e.g., leftovers from UI screens). Many are exported as metrics that I'm not sure are used by any actual user.

We should rethink and better design the way we handle stats. Of course, it's out of the scope of this PR, but we should start taking small steps and remove unnecessary information.
For example, endpoints_group_report - I did a quick search in the code, and it seems it isn't used at all:

get_endpoint_group_reports is called in 2 flows:

  1. get_endpoints_history - This was used for one of the UI graphs, and AFAIK it isn't used anymore
  2. _get_endpoint_groups - this is only called by read_system. There are a few internal flows in noobaa-core that call read_system (this by itself should be reconsidered), but it doesn't seem to use endpoint_groups field.

@tangledbytes @nimrod-becker @guymguym I think it's safe to remove endpoints_group_report. WDYT?

@tangledbytes
Copy link
Member Author

@dannyzaken wow, you are right. I stopped my search at read_system call. Yes, it doesn't seem like we utilize this.

I have two questions:

  1. Can we remove the collection and backport the removal as well?
  2. If we can't backport the removal then should this be merged and backported (so that the cleanup is there) and then a new PR be created and merged which removes the collection from master consequently future NooBaa releases?

cc: @nimrod-becker @guymguym

@dannyzaken
Copy link
Contributor

@tangledbytes I think that there shouldn't be a problem to backport it. the changes should be fairly small
@nimrod-becker @guymguym, any opinions?

@tangledbytes
Copy link
Member Author

tangledbytes commented Feb 29, 2024

@dannyzaken @nimrod-becker @guymguym @jackyalbo, I want to revive this PR. I think I am seeing a related issue again with the same customer.

@nimrod-becker
Copy link
Contributor

@dannyzaken @nimrod-becker @guymguym @jackyalbo, I want to revive this PR. I think I am seeing a related issue again with the same customer.

OFC, lets have it reviewed, merged to master and we can work on backporting up to 4.14

Copy link

This PR had no activity for too long - it will now be labeled stale. Update it to prevent it from getting closed.

@github-actions github-actions bot added the Stale label May 30, 2024
@nimrod-becker
Copy link
Contributor

keep alive

@github-actions github-actions bot removed the Stale label May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants