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

Tables with a DECIMAL key column cannot be restored from backups #10661

Closed
jepett0 opened this issue Oct 21, 2024 · 0 comments · Fixed by #10696
Closed

Tables with a DECIMAL key column cannot be restored from backups #10661

jepett0 opened this issue Oct 21, 2024 · 0 comments · Fixed by #10696
Assignees

Comments

@jepett0
Copy link
Collaborator

jepett0 commented Oct 21, 2024

Description

Please read the title.

Steps to reproduce

  1. Create a table with a DECIMAL key column and at least 2 partitions:
create table test_decimal (
    key Decimal(22,9),
    value Utf8,
    primary key(key),
)
with (
    AUTO_PARTITIONING_BY_SIZE = ENABLED,
    AUTO_PARTITIONING_PARTITION_SIZE_MB = 1,
    AUTO_PARTITIONING_MIN_PARTITIONS_COUNT = 2
);
  1. Fill the table so it would be split at least once:
huge_value definition

See the gist. Needs to be 100k+ symbols.

UPSERT INTO test_decimal (
    key,
    value
)
VALUES
    (CAST(1 as Decimal(22,9)), $huge_value),
    (CAST(2 as Decimal(22,9)), $huge_value),
    (CAST(3 as Decimal(22,9)), $huge_value),
    (CAST(4 as Decimal(22,9)), $huge_value),
    (CAST(5 as Decimal(22,9)), $huge_value),
    (CAST(6 as Decimal(22,9)), $huge_value),
    (CAST(7 as Decimal(22,9)), $huge_value),
    (CAST(8 as Decimal(22,9)), $huge_value),
    (CAST(9 as Decimal(22,9)), $huge_value),
    (CAST(10 as Decimal(22,9)), $huge_value),
    (CAST(11 as Decimal(22,9)), $huge_value),
    (CAST(12 as Decimal(22,9)), $huge_value),
    (CAST(13 as Decimal(22,9)), $huge_value),
    (CAST(14 as Decimal(22,9)), $huge_value),
    (CAST(15 as Decimal(22,9)), $huge_value),
    (CAST(16 as Decimal(22,9)), $huge_value),
    (CAST(17 as Decimal(22,9)), $huge_value),
    (CAST(18 as Decimal(22,9)), $huge_value),
    (CAST(19 as Decimal(22,9)), $huge_value),
    (CAST(20 as Decimal(22,9)), $huge_value);
  1. Wait for about a minute, so the test_decimal table would be split. Check that there are at least 2 partitions in it.
  2. Backup to S3 or call ydb tools dump --path test_decimal --scheme-only --output test_decimal_backup.
  3. Drop the test_decimal table.
  4. Restore from S3 or call ydb tools restore --path . --input test_decimal_backup depending on your choice at step 4.
  5. Observe that:
  • the export status is CANCELLED:
┌──────────────────────┬───────┬───────────┬───────────┬─────────────────────────┬────────────────────────┐
│ id                   │ ready │ status    │ progress  │ endpoint                │ bucket                 │
├──────────────────────┼───────┼───────────┼───────────┼─────────────────────────┼────────────────────────┤
│ ydb://import/8?id=84 │ true  │ CANCELLED │ Cancelled │ storage.yandexcloud.net │ ydb-backup-test-bucket │
│ 4424930141976&kind=s │       │           │           │                         │                        │
│ 3                    │       │           │           │                         │                        │
├╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴┴╴╴╴╴╴╴╴┴╴╴╴╴╴╴╴╴╴╴╴┴╴╴╴╴╴╴╴╴╴╴╴┴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴┴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴╴┤
│ Issues:                                                                                                 │
│   - <main>: Error: Error at split boundary 0: Unsupported typeId 4865 at index 0  
  • or the restore produces an error:
Status: SCHEME_ERROR
Issues: 
<main>: Info: Path: /Root/dedicated/test_decimal
<main>: Error: Error at split boundary 0: Unsupported typeId 4865 at index 0
@azevaykin azevaykin linked a pull request Oct 22, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants