Skip to content

Fix bug for GC may skip unexpected WriteBatches#2356

Merged
ti-srebot merged 2 commits intopingcap:masterfrom
JaySon-Huang:fix_compact_legacy
Jul 9, 2021
Merged

Fix bug for GC may skip unexpected WriteBatches#2356
ti-srebot merged 2 commits intopingcap:masterfrom
JaySon-Huang:fix_compact_legacy

Conversation

@JaySon-Huang
Copy link
Contributor

Signed-off-by: JaySon-Huang jayson.hjs@gmail.com

What problem does this PR solve?

Issue Number: close #2317

Problem Summary: After recovering from the crash in the middle of writing, GC can not successfully move forward cause the sequence number of WriteBatch among WAL is not consecutive. #2312 allow skipping non-consecutive sequence number, but we should not remove any {Formal/Legacy/Checkpoint} PageFiles before running LegacyCompactor, or we may skip some WriteBatches while compacting legacy files.

What is changed and how it works?

Should not remove any {Formal/Legacy/Checkpoint} PageFiles before running LegacyCompactor, or we may skip some WriteBatches while compacting legacy files.
Add check and comments under debug mode.

Related changes

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

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • No code

Side effects

Release note

  • No release note

Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
@JaySon-Huang
Copy link
Contributor Author

/run-all-tests

Copy link
Contributor

@flowbehappy flowbehappy 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-srebot ti-srebot added the status/LGT1 Indicates that a PR has LGTM 1. label Jul 9, 2021
@flowbehappy
Copy link
Contributor

/merge

@ti-srebot ti-srebot added the status/can-merge Indicates a PR has been approved by a committer. label Jul 9, 2021
@ti-srebot
Copy link
Collaborator

/run-all-tests

@ti-srebot ti-srebot merged commit 9f03c05 into pingcap:master Jul 9, 2021
@JaySon-Huang JaySon-Huang deleted the fix_compact_legacy branch July 13, 2021 10:29
JaySon-Huang added a commit to JaySon-Huang/tiflash that referenced this pull request Aug 4, 2021
JaySon-Huang added a commit to JaySon-Huang/tiflash that referenced this pull request Aug 4, 2021
flowbehappy pushed a commit that referenced this pull request Aug 4, 2021
* Ignore sequence hole among PageFile meta (#2312)

* Fix bug for GC may skip unexpected WriteBatches (#2356)

* Add length check while running PageStorage GC (#2394)

* PageStorage skip non continuous sequence safely (#2435)

* Fix PageStorage GC with high valid rate PageFile (#2436)

* More debug info for DeltaTree (query_id, snapshot lifetime) (#2431)

* Fix deadlock on `removeExpiredSnapshots` (#2461)

* Add grafana panels for write throughput per instance (#2524)
JaySon-Huang pushed a commit that referenced this pull request Aug 5, 2021
* Ignore sequence hole among PageFile meta (#2312)
* Fix bug for GC may skip unexpected WriteBatches (#2356)
* Add length check while running PageStorage GC (#2394)
* PageStorage skip non continuous sequence safely (#2435)
* Fix PageStorage GC with high valid rate PageFile (#2436)

Signed-off-by: JaySon-Huang <jayson.hjs@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status/can-merge Indicates a PR has been approved by a committer. status/LGT1 Indicates that a PR has LGTM 1.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PageStorage can not GC legacy files due to non-continuous sequence number

3 participants