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

[#57] Added support for hard links. #113

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Conversation

korydraughn
Copy link
Collaborator

@korydraughn korydraughn commented Jan 14, 2021

This PR needs to include documentation about the hard links REP. This also needs to be tested against the version of WinSCP that triggered this change.

Map<String, String> jsonInput = new HashMap<>();
jsonInput.put("operation", "hard_link_create");
jsonInput.put("logical_path", linkTargetPath.toString());
jsonInput.put("replica_number", "0");
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How do we want to handle cases where replica zero does not exist?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

This could be controlled via the following:

  • configuration
  • metadata
  • genquery that selects a specific replica based on certain criteria provided by the admin

Copy link
Member

Choose a reason for hiding this comment

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

i don't know how we could safely assume anything... doesn't it have to come from the catalog?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Maybe it executes genquery to find the latest good replica and it creates the hard link to that?

Copy link
Member

Choose a reason for hiding this comment

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

I think latest good replica is the answer... trying to figure out how to get that information without another trip to the catalog...

@michael-conway
Copy link
Member

michael-conway commented Jan 22, 2021 via email

@korydraughn
Copy link
Collaborator Author

Sure. Let me know when you'd like to do this.

Comment on lines +854 to +857
log_.debug("list - _parent = {}", linkParentPath); // The parent directory of _target.
log_.debug("list - _existing = {}", linkTargetPath); // The file or directory to link to.
log_.debug("list - _target = {}", _target); // The filename or absolute path of the link.
log_.debug("list - _subject = {}", Subjects.getUid(_subject)); // The UID of the user who executed this command.
Copy link
Member

Choose a reason for hiding this comment

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

list -> link

@@ -1299,7 +1370,7 @@ private Stat statPath(Path _path, long _inodeNumber) throws IOException

stat.setUid(userId);
stat.setGid(groupId);
stat.setNlink(1);
stat.setNlink(1); // TODO: Should hard links affect this number?
Copy link
Member

Choose a reason for hiding this comment

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

we'd increase it and then... decrease it somewhere else?

@trel trel marked this pull request as draft May 7, 2024 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants