Skip to content

feat(internal): Replace cp use with system call#11

Merged
johnchildren merged 1 commit intomasterfrom
feat/syscall-reflink
Nov 1, 2023
Merged

feat(internal): Replace cp use with system call#11
johnchildren merged 1 commit intomasterfrom
feat/syscall-reflink

Conversation

@johnchildren
Copy link
Copy Markdown
Collaborator

Previously the flags we provided to cp were compiled into the library based on platform, this caused issues when using a different binary to the one provided by the system as flags were sometimes not available.

This commit adds a dependency on reflink-copy to enable the same copy on write behavior for postgresql directories but without using the cp binary directly.

Previously the flags we provided to cp were compiled into the library
based on platform, this caused issues when using a different binary to
the one provided by the system as flags were sometimes not available.

This commit adds a dependency on reflink-copy to enable the same copy on
write behavior for postgresql directories but without using the cp
binary directly.
Copy link
Copy Markdown

@isobelhooper isobelhooper left a comment

Choose a reason for hiding this comment

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

Clarified with John - because reflink-copy only does COW for files, our code has to do the "copy recursively" logic itself, by creating the target directories and generating all the target file paths.

Looks like it does that well. 👍

@quantinuum-richard-morrison
Copy link
Copy Markdown

Also confirmed - in an environment where cp resolves to the unix-flavoured cp provided by coreutils, this succeeds. It also succeeds in an environment where cp resolves to the Mac OS-flavoured cp. In other words, things are independent of the behaviour of cp, as expected.

@johnchildren johnchildren merged commit a3e29c1 into master Nov 1, 2023
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.

4 participants