Skip to content

Fix the wrong result of reading single format DTFile & misplaced Grafana panel (#1803)#1806

Merged
JaySon-Huang merged 1 commit intopingcap:release-5.0from
ti-srebot:release-5.0-2e6b588c386a
Apr 21, 2021
Merged

Fix the wrong result of reading single format DTFile & misplaced Grafana panel (#1803)#1806
JaySon-Huang merged 1 commit intopingcap:release-5.0from
ti-srebot:release-5.0-2e6b588c386a

Conversation

@ti-srebot
Copy link
Collaborator

@ti-srebot ti-srebot commented Apr 21, 2021

cherry-pick #1803 to release-5.0
You can switch your code base to this Pull Request by using git-extras:

# In tics repo:
git pr https://github.com/pingcap/tics/pull/1806

After apply modifications, you can push your change to this PR via:

git push git@github.com:ti-srebot/tics.git pr/1806:release-5.0-2e6b588c386a

What problem does this PR solve?

Issue Number: close #1787

Problem Summary:

  1. Sometime the panel Region write Duration (write blocks) appear in weird places. It is because the panel share a same "id=77" with the panel Handling Request Number
  2. After restored DTFiles (single file mode), we may get inconsistent rows from a DTFile even if we read with a same key range. Because the min-max indexes can not be loaded successfully.

What is changed and how it works?

  1. Fix the id of panel and re-export the json file for TiFlash-Summary
  2. Do DMFile::initializeSubFileStatIfNeeded inside DMFilePackFilter::init to ensure we can load min-max indexes if they exist.
  3. Do DMFile::initializeSubFileStatIfNeeded inside DMFile::readMeta.
    @lidezhu split the functions from readMeta to reduce the number of bytes read from the disk while initiating. But it brings another problem: We need to acquire a lock for checking whether the file is single-mode and sub_file_stats is empty every time we create a DMFileFilter. No matter the file is single-mode or directory-mode.
    Those data are small and we can optimize the initlizating by lazy init DeltaMergeStore.

Related changes

  • PR to update pingcap/docs/pingcap/docs-cn:
  • Need to cherry-pick to the release branch: 5.0

Check List

Tests

  • Unit test

Side effects

  • N/A

Release note

  • Fix the bug that the Grafana panel Region write Duration (write blocks) may be shown in wrong place

Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
@ti-srebot ti-srebot added CHERRY-PICK cherry pick status/LGT1 Indicates that a PR has LGTM 1. type/bugfix This PR fixes a bug. labels Apr 21, 2021
@ti-srebot ti-srebot requested a review from flowbehappy April 21, 2021 13:10
@ti-srebot ti-srebot added this to the v5.0.1 milestone Apr 21, 2021
@JaySon-Huang JaySon-Huang requested a review from lidezhu April 21, 2021 13:17
@JaySon-Huang
Copy link
Contributor

/run-all-tests

@JaySon-Huang JaySon-Huang merged commit 1821cf6 into pingcap:release-5.0 Apr 21, 2021
@JaySon-Huang JaySon-Huang deleted the release-5.0-2e6b588c386a branch April 21, 2021 15:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CHERRY-PICK cherry pick status/LGT1 Indicates that a PR has LGTM 1. type/bugfix This PR fixes a bug.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants