Skip to content

[Audit][Stream Load] Support audit function for stream load#5452

Merged
morningman merged 6 commits intoapache:masterfrom
weizuo93:stream-load-audit
Apr 21, 2021
Merged

[Audit][Stream Load] Support audit function for stream load#5452
morningman merged 6 commits intoapache:masterfrom
weizuo93:stream-load-audit

Conversation

@weizuo93
Copy link
Contributor

@weizuo93 weizuo93 commented Mar 3, 2021

Proposed changes

Record finished stream load job (both successful job and failed job) into audit log so that we can see when the stream load job was executed and check the details of stream load jobs.

2021-03-09 14:11:51,821 [stream_load] |Label=1615270311|Db=test_db_1|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8926|StartTime=2021-03-09 14:11:51.692|FinishTime=2021-03-09 14:11:51.819
2021-03-09 14:11:52,969 [stream_load] |Label=1615270312|Db=test_db_2|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8926|StartTime=2021-03-09 14:11:52.848278|FinishTime=2021-03-09 14:11:52.968169
2021-03-09 14:11:54,122 [stream_load] |Label=1615270313|Db=test_db_3|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8926|StartTime=2021-03-09 14:11:53.995|FinishTime=2021-03-09 14:11:54.120
2021-03-09 14:12:00,494 [stream_load] |Label=1615270320|Db=test_db_0|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8947|StartTime=2021-03-09 14:12:00.314894|FinishTime=2021-03-09 14:12:00.493533
2021-03-09 14:12:01,648 [stream_load] |Label=1615270321|Db=test_db_1|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8947|StartTime=2021-03-09 14:12:01.525|FinishTime=2021-03-09 14:12:01.649
2021-03-09 14:12:02,809 [stream_load] |Label=1615270322|Db=test_db_2|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8947|StartTime=2021-03-09 14:12:02.675|FinishTime=2021-03-09 14:12:02.803
2021-03-09 14:12:03,957 [stream_load] |Label=1615270323|Db=test_db_3|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8947|StartTime=2021-03-09 14:12:03.831452|FinishTime=2021-03-09 14:12:03.955965
2021-03-09 14:12:10,333 [stream_load] |Label=1615270330|Db=test_db_0|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8928|StartTime=2021-03-09 14:12:10.209635|FinishTime=2021-03-09 14:12:10.332249
2021-03-09 14:12:11,548 [stream_load] |Label=1615270331|Db=test_db_1|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8928|StartTime=2021-03-09 14:12:11.363|FinishTime=2021-03-09 14:12:11.549
2021-03-09 14:12:12,702 [stream_load] |Label=1615270332|Db=test_db_2|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8928|StartTime=2021-03-09 14:12:12.574945|FinishTime=2021-03-09 14:12:12.700693
2021-03-09 14:12:13,914 [stream_load] |Label=1615270333|Db=test_db_3|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8928|StartTime=2021-03-09 14:12:13.731|FinishTime=2021-03-09 14:12:13.915
2021-03-09 14:12:20,237 [stream_load] |Label=1615270340|Db=test_db_0|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8933|StartTime=2021-03-09 14:12:20.110|FinishTime=2021-03-09 14:12:20.237
2021-03-09 14:12:21,391 [stream_load] |Label=1615270341|Db=test_db_1|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8933|StartTime=2021-03-09 14:12:21.264|FinishTime=2021-03-09 14:12:21.389
2021-03-09 14:12:22,557 [stream_load] |Label=1615270342|Db=test_db_2|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8933|StartTime=2021-03-09 14:12:22.418|FinishTime=2021-03-09 14:12:22.554
2021-03-09 14:12:23,720 [stream_load] |Label=1615270343|Db=test_db_3|Table=table_test|User=root|ClientIp=xxx|Status=Success|Message=OK|Url=N/A|TotalRows=200|LoadedRows=200|FilteredRows=0|UnselectedRows=0|LoadBytes=8933|StartTime=2021-03-09 14:12:23.587|FinishTime=2021-03-09 14:12:23.718

Types of changes

What types of changes does your code introduce to Doris?
Put an x in the boxes that apply

  • [] Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [] Documentation Update (if none of the other choices apply)
  • Code refactor (Modify the code structure, format the code, etc...)

Checklist

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • [] I have created an issue on (Fix #ISSUE) and described the bug/feature there in detail
  • Compiling and unit tests pass locally with my changes
  • [] I have added tests that prove my fix is effective or that my feature works
  • [] If these changes need document changes, I have updated the document
  • Any dependent changes have been merged

@weizuo93 weizuo93 force-pushed the stream-load-audit branch from 3980b76 to a3ebfd4 Compare March 16, 2021 06:13
@morningman morningman self-assigned this Mar 21, 2021
@morningman morningman added the kind/feature Categorizes issue or PR as related to a new feature. label Mar 21, 2021
@morningman
Copy link
Contributor

And I pulled and run your PR, submit several stream load.
I can see log put stream_load_record rocksdb successfully. label: f0130520-835a-4d05-a38d-95f67f5b8c7b in be.INFO.
And I can see log finished to pull stream load records of all backend in fe.log.

But there is nothing got from BE. I don't know why, maybe you need to check it.

@weizuo93
Copy link
Contributor Author

And I pulled and run your PR, submit several stream load.
I can see log put stream_load_record rocksdb successfully. label: f0130520-835a-4d05-a38d-95f67f5b8c7b in be.INFO.
And I can see log finished to pull stream load records of all backend in fe.log.

But there is nothing got from BE. I don't know why, maybe you need to check it.

I test again. There should be nothing wrong.

@weizuo93 weizuo93 force-pushed the stream-load-audit branch from d087f5f to 30eae4b Compare April 6, 2021 06:01
Copy link
Contributor

@morningman morningman left a comment

Choose a reason for hiding this comment

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

LGTM

@morningman morningman added the approved Indicates a PR has been approved by one committer. label Apr 20, 2021
@morningman morningman merged commit a4f8194 into apache:master Apr 21, 2021
EmmyMiao87 pushed a commit to EmmyMiao87/incubator-doris that referenced this pull request May 14, 2021
)

Record finished stream load job (both successful job and failed job) into audit log
so that we can see when the stream load job was executed and check the details of stream load jobs.

Change-Id: I67f806a82f7b4f9d0ee28be5e9ad52e8c2a93aff
@morningman morningman mentioned this pull request Oct 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by one committer. kind/feature Categorizes issue or PR as related to a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants