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

feat: add delete/drop into tianmu log stat #1747

Conversation

duanjr
Copy link
Contributor

@duanjr duanjr commented May 8, 2023

Summary about this PR

feat: add delete/truncate into log stat (#1398 )

Tests Check List

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

Manual test

sql code:

DROP DATABASE THU;

CREATE DATABASE THU;

USE THU;

CREATE TABLE student (
    id INT NOT NULL,
    uid INT,
    name VARCHAR(20)
);

ALTER TABLE student ADD INDEX (uid);

ALTER TABLE student ADD INDEX (id);

INSERT INTO student VALUES (228, NULL, 'wangzhidong');

INSERT INTO student VALUES (238, 5, 'qianhoude');

INSERT INTO student VALUES (292, 3, 'sunxun');

INSERT INTO student VALUES (300, 5, 'xuchenxi');

SELECT * FROM student WHERE student.id = 228;

SELECT * FROM student WHERE student.uid = 5;

delete from student where uid = 5;

SELECT * FROM student;

truncate table student;

SELECT * FROM student;

related output in tianmu.log:

[2023-05-08 16:59:38.564431] [873585] [INFO] [engine.cpp:1614] MSG: Command: select 0/0, update 0/0, insert 0/0, delete 0/0, truncate 0/0, load 0/0, queries 0/1
[2023-05-08 17:00:38.564740] [873585] [INFO] [engine.cpp:1614] MSG: Command: select 0/0, update 0/0, insert 0/0, delete 0/0, truncate 0/0, load 0/0, queries 3/4
[2023-05-08 17:01:38.565053] [873585] [INFO] [engine.cpp:1614] MSG: Command: select 3/3, update 0/0, insert 4/4, delete 0/0, truncate 0/0, load 0/0, queries 13/17
[2023-05-08 17:02:38.565352] [873585] [INFO] [engine.cpp:1614] MSG: Command: select 3/6, update 0/0, insert 0/4, delete 1/1, truncate 1/1, load 0/0, queries 6/23
[2023-05-08 17:03:38.565661] [873585] [INFO] [engine.cpp:1614] MSG: Command: select 0/6, update 0/0, insert 0/4, delete 0/1, truncate 0/1, load 0/0, queries 0/23

Changelog

  • New Feature
  • Bug Fix
  • Performance Improvement
  • Build/Testing/CI/CD
  • Documentation
  • Not for changelog (changelog entry is not required)

Documentation

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features

@mergify
Copy link
Contributor

mergify bot commented May 8, 2023

This pull request's title should follow requirements next. @duanjr please check it 👇.

Valid format:

fix(vc): fix sth..... (#3306)
  ^         ^---------^  ^----^
  |         |            |
  |         +            +-> you issue id.
  |         |
  |         +-> Summary in present tense.
  |
  +-------> Type: feat, fix, docs, workflow, style, refactor, test, website, chore

Valid types:

  • feat: new feature for stonedb
  • fix: bug fix for stonedb
  • docs: changes to the documentation
  • workflow: ci/cd in .github
  • perf: Changes to improve code performance
  • refactor: refactoring production code, eg. renaming a variable
  • style: formatting, missing semi colons, etc; no production code change
  • test: adding missing tests, refactoring tests; no production code change
  • website
  • chore: updating grunt tasks etc; no production code change

@mergify
Copy link
Contributor

mergify bot commented May 8, 2023

Thanks for the contribution!
I have applied any labels matching special text in your PR Changelog.

Please review the labels and make any necessary changes.

@Nliver Nliver requested review from RingsC and haitaoguan May 8, 2023 09:20
@Nliver Nliver added this to the StoneDB_5.7_v1.0.4 milestone May 8, 2023
@CLAassistant
Copy link

CLAassistant commented May 8, 2023

CLA assistant check
All committers have signed the CLA.

@duanjr duanjr changed the title add delete/drop into tianmu log stat feat: add delete/drop into tianmu log stat May 8, 2023
@mergify mergify bot added the PR-feature feature for pull request label May 8, 2023
@Nliver Nliver requested review from adofsauron and konghaiya and removed request for haitaoguan May 9, 2023 01:35
@konghaiya
Copy link
Collaborator

konghaiya commented May 9, 2023

@duanjr Why is it only open for delete and truncate, while others can also be opened?

@duanjr
Copy link
Contributor Author

duanjr commented May 9, 2023

@duanjr Why is it only open for delete and truncate, while others can also be opened?

I’m also confused about this, according to discussion here, we add log about delete and truncate because tianmu engine has just been able to support the corresponding operations. But before the tianmu engine supports delete, truncate and drop, we can output logs for operations such as creating tables. I don't know why the original developer didn't open them, so I didn't modify them without authorization.

@konghaiya
Copy link
Collaborator

Other operations are also supported by Tianmu and can be opened for testing

@konghaiya
Copy link
Collaborator

Previously, it was not supported because the Tianmu engine only serves as an AP engine and does not support some functions of these DDL and DML operations,
But now Tianmu has become an HTAP engine that supports these operations.

@duanjr
Copy link
Contributor Author

duanjr commented May 9, 2023

Log for all operations are opened know, and the log info is like the first code line here.
I'm not sure if further testing is needed.

@konghaiya
Copy link
Collaborator

Log for all operations are opened know, and the log info is like the first code line here. I'm not sure if further testing is needed.

You can send the test results here

Copy link
Collaborator

@konghaiya konghaiya left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented May 11, 2023

Codecov Report

Patch coverage has no change and project coverage change: +55.17 🎉

Comparison is base (304df8e) 0.00% compared to head (be1dc33) 55.17%.

❗ Current head be1dc33 differs from pull request most recent head 2b62fe7. Consider uploading reports for the commit 2b62fe7 to get more accurate results

Additional details and impacted files
@@                 Coverage Diff                  @@
##           stonedb-5.7-dev    #1747       +/-   ##
====================================================
+ Coverage                 0   55.17%   +55.17%     
====================================================
  Files                    0     2031     +2031     
  Lines                    0   431435   +431435     
====================================================
+ Hits                     0   238037   +238037     
- Misses                   0   193398   +193398     
Impacted Files Coverage Δ
storage/tianmu/core/engine.cpp 64.12% <0.00%> (ø)

... and 2030 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@mergify mergify bot merged commit 141918d into stoneatom:stonedb-5.7-dev May 11, 2023
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR-feature feature for pull request
Projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants