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

return zip instead of tar or gzip #724

Merged
merged 17 commits into from
Sep 8, 2020

Conversation

baurine
Copy link
Collaborator

@baurine baurine commented Aug 6, 2020

resolve #718

@baurine baurine marked this pull request as draft August 6, 2020 09:39
@breezewish
Copy link
Member

Instance profiling may need to be updated as well (which is what issue targets at)

@baurine
Copy link
Collaborator Author

baurine commented Aug 7, 2020

Instance profiling may need to be updated as well (which is what issue targets at)

Yep, working on it now.

@baurine baurine marked this pull request as ready for review August 7, 2020 05:18
@baurine
Copy link
Collaborator Author

baurine commented Aug 7, 2020

TODO:

  • find a windows environment to test it.

Tested in windows and it works fine.

@breeswish PTAL, thanks!


_, err = io.Copy(tw, f)
err = utils.CreateZipPack(temp, filePaths)
Copy link
Member

Choose a reason for hiding this comment

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

Will it be too slow to zip again when there are a lot of logs? (for example, 5 GB)

Note that previously it is a tar stream on the fly using io.Copy, which is roughly a memory copy and does not need to wait for everything to finish as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, this may be a problem, let me check it.

Copy link
Collaborator Author

@baurine baurine Aug 20, 2020

Choose a reason for hiding this comment

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

zip provides an option to allow us not to compress the files, ref: https://stackoverflow.com/a/23717581/2998877 , has updated the code.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@baurine baurine marked this pull request as draft September 4, 2020 09:21
@baurine baurine marked this pull request as ready for review September 7, 2020 02:00
@baurine
Copy link
Collaborator Author

baurine commented Sep 7, 2020

Hi @breeswish , now the zip pack file is streamed, and works fine when testing, PTAL, thanks! ref: https://stackoverflow.com/questions/57429256/how-to-generate-zip-7z-archive-on-the-fly-in-a-http-server-using-gin/57434338#57434338

@breezewish
Copy link
Member

Good job! Mostly lgtm. The only thing I'm worrying is that you are using defer in loops, which usually behaves like something you are not expecting. Would you like to move it to a standalone function so that defer will run immediately after each loop iteration?

@baurine
Copy link
Collaborator Author

baurine commented Sep 8, 2020

Good job! Mostly lgtm. The only thing I'm worrying is that you are using defer in loops, which usually behaves like something you are not expecting. Would you like to move it to a standalone function so that defer will run immediately after each loop iteration?

Ok, let me try.

@breezewish breezewish merged commit 1dc0480 into pingcap:master Sep 8, 2020
breezewish pushed a commit that referenced this pull request Sep 8, 2020
breezewish added a commit that referenced this pull request Sep 8, 2020
* feature: Query Editor (#713)
* Backend: replace UNIX_TIMESTAMP with FROM_UNIXTIME in statement query (#731)
* test: Stablize e2e tests (#732)
* ui: Add store location tree (#728)
* log_search: Display instance port (#722)
* ui: show store location topology (#719)
* ui: Online Config (#733)
* ui: Support sharing session (#741)
* doc: Update to sig-diagnosis (#742)
* statement: Display number of plans in the list (#746)
* log search: return zip instead of tar or gzip (#724)
@baurine baurine deleted the change-tar-to-zip branch September 8, 2020 11:15
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 this pull request may close these issues.

Support .zip format for profile
3 participants