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

Storage: let stable meta using protobuf format #9054

Merged
merged 10 commits into from
May 17, 2024

Conversation

Lloyd-Pottiger
Copy link
Contributor

What problem does this PR solve?

Issue Number: ref #9036

Problem Summary:

What is changed and how it works?

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

None

Signed-off-by: Lloyd-Pottiger <[email protected]>
@ti-chi-bot ti-chi-bot bot added 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 May 16, 2024
Signed-off-by: Lloyd-Pottiger <[email protected]>
Signed-off-by: Lloyd-Pottiger <[email protected]>
Copy link
Member

@breezewish breezewish left a comment

Choose a reason for hiding this comment

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

The rest LGTM

dbms/src/Storages/DeltaMerge/Proto/stable.proto Outdated Show resolved Hide resolved
dbms/src/Storages/DeltaMerge/StableValueSpace.cpp Outdated Show resolved Hide resolved
dbms/src/Storages/DeltaMerge/StableValueSpace.cpp Outdated Show resolved Hide resolved
dbms/src/Storages/FormatVersion.h Show resolved Hide resolved
dbms/src/Storages/FormatVersion.h Show resolved Hide resolved
Signed-off-by: Lloyd-Pottiger <[email protected]>
@Lloyd-Pottiger Lloyd-Pottiger requested a review from breezewish May 17, 2024 09:16
Comment on lines 93 to 111
if (STORAGE_FORMAT_CURRENT.stable == StableFormat::V1)
{
writeIntBinary(valid_rows, buf);
writeIntBinary(valid_bytes, buf);
writeIntBinary(static_cast<UInt64>(files.size()), buf);
for (const auto & f : files)
writeIntBinary(f->pageId(), buf);
}
else if (STORAGE_FORMAT_CURRENT.stable == StableFormat::V2)
{
dtpb::StableLayerMeta meta;
meta.set_valid_rows(valid_rows);
meta.set_valid_bytes(valid_bytes);
for (const auto & f : files)
meta.add_files()->set_page_id(f->pageId());

auto data = meta.SerializeAsString();
writeStringBinary(data, buf);
}
Copy link
Contributor

Choose a reason for hiding this comment

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

put if (likely(STORAGE_FORMAT_CURRENT.stable == StableFormat::V2)) in the first check

Copy link
Contributor Author

Choose a reason for hiding this comment

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

current use v1, so if (likely(STORAGE_FORMAT_CURRENT.stable == StableFormat::V1))

Signed-off-by: Lloyd-Pottiger <[email protected]>
Copy link
Contributor

@JaySon-Huang JaySon-Huang left a comment

Choose a reason for hiding this comment

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

Rest LGTM

@ti-chi-bot ti-chi-bot bot added needs-1-more-lgtm Indicates a PR needs 1 more LGTM. approved labels May 17, 2024
Signed-off-by: Lloyd-Pottiger <[email protected]>
Copy link
Member

@breezewish breezewish left a comment

Choose a reason for hiding this comment

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

Some tiny optional changes.

dbms/src/Storages/DeltaMerge/File/dtpb/dmfile.proto Outdated Show resolved Hide resolved
return buf.count();
}

namespace
Copy link
Member

Choose a reason for hiding this comment

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

Is this dummy namespace a typo?

dbms/src/Storages/DeltaMerge/StableValueSpace.h Outdated Show resolved Hide resolved
dbms/src/Storages/DeltaMerge/StableValueSpace.h Outdated Show resolved Hide resolved
@ti-chi-bot ti-chi-bot bot added the lgtm label May 17, 2024
Copy link
Contributor

ti-chi-bot bot commented May 17, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: breezewish, JaySon-Huang

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

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [JaySon-Huang,breezewish]

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 removed the needs-1-more-lgtm Indicates a PR needs 1 more LGTM. label May 17, 2024
Copy link
Contributor

ti-chi-bot bot commented May 17, 2024

[LGTM Timeline notifier]

Timeline:

  • 2024-05-17 09:59:13.294150327 +0000 UTC m=+1820107.051285902: ☑️ agreed by JaySon-Huang.
  • 2024-05-17 12:15:33.158131471 +0000 UTC m=+1828286.915267044: ☑️ agreed by breezewish.

@Lloyd-Pottiger
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 May 17, 2024
Signed-off-by: Lloyd-Pottiger <[email protected]>
@Lloyd-Pottiger
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 May 17, 2024
@ti-chi-bot ti-chi-bot bot merged commit d33545d into pingcap:master May 17, 2024
5 checks passed
}
else
{
throw Exception("Unexpected version: {}", STORAGE_FORMAT_CURRENT.stable);
Copy link
Contributor

Choose a reason for hiding this comment

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

throw Exception(ErrorCodes::LOGICAL_ERROR, "Unexpected version: {}", STORAGE_FORMAT_CURRENT.stable);

else if (version == StableFormat::V2)
return derializeMetaV2FromBuf(buf);
else
throw Exception("Unexpected version: {}", version);
Copy link
Contributor

Choose a reason for hiding this comment

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

throw Exception(ErrorCodes::LOGICAL_ERROR, "Unexpected version: {}", version);

@JaySon-Huang
Copy link
Contributor

#9054 (review)
/cc @Lloyd-Pottiger

Copy link
Contributor

ti-chi-bot bot commented May 27, 2024

@JaySon-Huang: GitHub didn't allow me to request PR reviews from the following users: Lloyd-Pottiger.

Note that only pingcap members and repo collaborators can review this PR, and authors cannot review their own PRs.

In response to this:

#9054 (review)
/cc @Lloyd-Pottiger

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@Lloyd-Pottiger Lloyd-Pottiger deleted the proto-stable branch May 28, 2024 02:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved lgtm 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.

3 participants