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(snapshots): added support for reading from named pipes #3034

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

acul009
Copy link

@acul009 acul009 commented May 15, 2023

Hi,

this is just 2 lines, which makes kopia read named pipes like files. I'd like to use that for streaming multiple database dumps in the same snapshot, so the backup is atomic.

@codecov
Copy link

codecov bot commented Jun 10, 2023

Codecov Report

Patch coverage: 60.00% and project coverage change: -0.01% ⚠️

Comparison is base (1320f0c) 75.52% compared to head (163091b) 75.52%.
Report is 2 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3034      +/-   ##
==========================================
- Coverage   75.52%   75.52%   -0.01%     
==========================================
  Files         460      460              
  Lines       36641    36646       +5     
==========================================
+ Hits        27674    27677       +3     
  Misses       7050     7050              
- Partials     1917     1919       +2     
Files Changed Coverage Δ
fs/localfs/local_fs.go 83.33% <60.00%> (-0.56%) ⬇️

... and 7 files with indirect coverage changes

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@acul009 acul009 changed the title added support for reading from named pipes feat(snapshots): added support for reading from named pipes Jun 11, 2023
@@ -356,6 +356,7 @@ func Directory(path string) (fs.Directory, error) {
func entryFromDirEntry(fi os.FileInfo, prefix string) fs.Entry {
isplaceholder := strings.HasSuffix(fi.Name(), ShallowEntrySuffix)
maskedmode := fi.Mode() & os.ModeType
readNamedEnv := os.Getenv("KOPIA_SNAPSHOT_NAMED_PIPES")
Copy link
Contributor

Choose a reason for hiding this comment

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

this function is called in a tight loop, reading from environment has non-trivial cost and should be avoided in such a place.

Copy link
Author

Choose a reason for hiding this comment

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

Thanks for reviewing :)

I‘ll update the PR to cache the value.

Copy link
Author

Choose a reason for hiding this comment

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

I moved the variable outside the function. This should fix the performance issues.

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.

2 participants