Skip to content

vector: Reduce logging under debug level#9852

Merged
ti-chi-bot[bot] merged 5 commits intopingcap:masterfrom
JaySon-Huang:fix_vec_logging
Feb 8, 2025
Merged

vector: Reduce logging under debug level#9852
ti-chi-bot[bot] merged 5 commits intopingcap:masterfrom
JaySon-Huang:fix_vec_logging

Conversation

@JaySon-Huang
Copy link
Contributor

@JaySon-Huang JaySon-Huang commented Feb 8, 2025

What problem does this PR solve?

Issue Number: close #9854

Problem Summary:

When we try to add a vector index on a relative large table, there are much useless logging under debug level

  • After DDL owner try to add a vector index, the tidb ddl owner will get the add index progress by fetching system.dt_local_indexes from all tiflash instances
  • StorageSystemDTLocalIndexes::read call getLocalIndexesStatsFromStorage. For non-inited DeltaMergeStore, the function calls genLocalIndexStatsByTableInfo -> initLocalIndexInfos -> generateLocalIndexInfos and generate useless logging like "Local index info does not changed, ..." for each StorageDeltaMerge. This will cause much debug logging when there are lots of tables in the cluster

What is changed and how it works?

* Move the logging from `generateLocalIndexInfos` to `DeltaMergeStore::applyLocalIndexChange`. Reduce logging that is not cause by DDL changed
* Return the keep/added/dropped index ids in `LocalIndexInfosChangeset` and generate the changeset logging string by `LocalIndexInfosChangeset::toString`

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
Deploy a cluster with tiflash and enable debug level logging
Load a dataset with 1m vector data
Add vector index and wait
  • No code

Side effects

  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Breaking backward compatibility

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Changes MySQL compatibility

Release note

None

Signed-off-by: JaySon-Huang <tshent@qq.com>
Signed-off-by: JaySon-Huang <tshent@qq.com>
@ti-chi-bot ti-chi-bot bot added do-not-merge/needs-linked-issue release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Feb 8, 2025
@JaySon-Huang JaySon-Huang changed the title vector: Fix logging under debug level vector: Reduce logging under debug level Feb 8, 2025
Signed-off-by: JaySon-Huang <tshent@qq.com>
Copy link
Member

@CalvinNeo CalvinNeo left a comment

Choose a reason for hiding this comment

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

lgtm

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Feb 8, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Feb 8, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: CalvinNeo, Lloyd-Pottiger

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:
  • OWNERS [CalvinNeo,Lloyd-Pottiger]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@ti-chi-bot ti-chi-bot bot added lgtm and removed needs-1-more-lgtm Indicates a PR needs 1 more LGTM. labels Feb 8, 2025
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Feb 8, 2025

[LGTM Timeline notifier]

Timeline:

  • 2025-02-08 08:35:36.414736966 +0000 UTC m=+86378.810959023: ☑️ agreed by CalvinNeo.
  • 2025-02-08 08:46:15.241612351 +0000 UTC m=+87017.637834411: ☑️ agreed by Lloyd-Pottiger.

@ti-chi-bot ti-chi-bot bot added the needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. label Feb 8, 2025
@JaySon-Huang
Copy link
Contributor Author

/hold

@ti-chi-bot ti-chi-bot bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 8, 2025
Signed-off-by: JaySon-Huang <tshent@qq.com>
@JaySon-Huang
Copy link
Contributor Author

/unhold

@ti-chi-bot ti-chi-bot bot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Feb 8, 2025
@ti-chi-bot ti-chi-bot bot merged commit 20cdf6d into pingcap:master Feb 8, 2025
5 checks passed
@JaySon-Huang JaySon-Huang deleted the fix_vec_logging branch February 8, 2025 14:48
@ti-chi-bot
Copy link
Member

In response to a cherrypick label: new pull request created to branch release-8.5: #9858.
But this PR has conflicts, please resolve them!

ti-chi-bot pushed a commit to ti-chi-bot/tiflash that referenced this pull request Feb 8, 2025
Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot bot pushed a commit that referenced this pull request Feb 10, 2025
close #9854

* Move the logging from `generateLocalIndexInfos` to `DeltaMergeStore::applyLocalIndexChange`. Reduce logging that is not cause by DDL changed
* Return the keep/added/dropped index ids in `LocalIndexInfosChangeset` and generate the changeset logging string by `LocalIndexInfosChangeset::toString`

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: JaySon-Huang <tshent@qq.com>

Co-authored-by: JaySon <tshent@qq.com>
Co-authored-by: JaySon-Huang <tshent@qq.com>
JaySon-Huang added a commit to JaySon-Huang/tiflash that referenced this pull request Mar 4, 2025
pingcap#362)

Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io>
yongman pushed a commit to yongman/tiflash that referenced this pull request Jun 18, 2025
close pingcap#9854

* Move the logging from `generateLocalIndexInfos` to `DeltaMergeStore::applyLocalIndexChange`. Reduce logging that is not cause by DDL changed
* Return the keep/added/dropped index ids in `LocalIndexInfosChangeset` and generate the changeset logging string by `LocalIndexInfosChangeset::toString`

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: JaySon-Huang <tshent@qq.com>

Co-authored-by: JaySon <tshent@qq.com>
Co-authored-by: JaySon-Huang <tshent@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved lgtm needs-cherry-pick-release-8.5 Should cherry pick this PR to release-8.5 branch. release-note-none Denotes a PR that doesn't merit a release note. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Too much useless debug level logging when adding vector index

4 participants