Skip to content

disagg: Fix error when there are empty partitions (#8221)#8224

Merged
ti-chi-bot[bot] merged 2 commits intopingcap:release-7.5from
ti-chi-bot:cherry-pick-8221-to-release-7.5
Oct 19, 2023
Merged

disagg: Fix error when there are empty partitions (#8221)#8224
ti-chi-bot[bot] merged 2 commits intopingcap:release-7.5from
ti-chi-bot:cherry-pick-8221-to-release-7.5

Conversation

@ti-chi-bot
Copy link
Member

This is an automated cherry-pick of #8221

What problem does this PR solve?

Issue Number: close #8220

Problem Summary:

When there are empty partition tables, we may receive EstablishDisaggTaskResponse with empty segment read tasks because the SchemaBuilder won't construct a table with a segment without any rows inside it.

create database if not exists partition360;
create table if not exists `partition360`.`partition360_8` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT COMMENT '自增id',
  `m_req_all` bigint(20) unsigned NOT NULL DEFAULT '0',
  `text` varchar(2048)        NOT NULL default '',
  `create_date` date NOT NULL DEFAULT '2000-01-01',
  `aid` int(11) unsigned NOT NULL DEFAULT '0',
  `atime` time NOT NULL DEFAULT '-01:00:00',
  `create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`,`create_date`) /*T![clustered_index] NONCLUSTERED */,
  UNIQUE KEY `unq_p` (`aid`, `atime`, `create_date`)
  ) PARTITION BY RANGE COLUMNS(create_date) (
  PARTITION `p20210506` VALUES LESS THAN ("20210507"),
  PARTITION `p20210507` VALUES LESS THAN ("20210508")
  )
alter table partition360_8 set tiflash replica 2;
select * from partition360_8;
(1105, 'other error for mpp stream: Code: 49, e.displayText() = DB::Exception: Check n > 0 failed, n = 0, e.what() = DB::Exception,')

What is changed and how it works?

Add an empty channel for RNWorkers in this situation

Check List

Tests

  • Unit test
  • Integration test
  • Manual test (add detailed scripts or steps below)
  • 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

Fix the issue that executing queries on empty partitions causes query failure

@ti-chi-bot ti-chi-bot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-7.5 This PR is cherry-picked to release-7.5 from a source PR. labels Oct 19, 2023
@ti-chi-bot ti-chi-bot added cherry-pick-approved Cherry pick PR approved by release team. labels Oct 19, 2023
@JaySon-Huang
Copy link
Contributor

/run-all-tests

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels Oct 19, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Oct 19, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JaySon-Huang, 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 [JaySon-Huang,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 Oct 19, 2023
@ti-chi-bot
Copy link
Contributor

ti-chi-bot bot commented Oct 19, 2023

[LGTM Timeline notifier]

Timeline:

  • 2023-10-19 10:34:52.014705055 +0000 UTC m=+1912489.601815204: ☑️ agreed by JaySon-Huang.
  • 2023-10-19 10:41:46.250902173 +0000 UTC m=+1912903.838012302: ☑️ agreed by Lloyd-Pottiger.

@ti-chi-bot ti-chi-bot bot merged commit cbec4a0 into pingcap:release-7.5 Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved cherry-pick-approved Cherry pick PR approved by release team. lgtm release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. type/cherry-pick-for-release-7.5 This PR is cherry-picked to release-7.5 from a source PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants