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

Set acl in zk.set, zk.acquire_lock and zk.create functions #80

Merged
merged 1 commit into from
Aug 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
cmd/rdsync/rdsync
tests/logs/
.idea
6 changes: 3 additions & 3 deletions internal/dcs/zk.go
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ func (z *zkDCS) AcquireLock(path string) bool {
if err != nil {
panic(fmt.Sprintf("failed to serialize to JSON %#v", self))
}
_, err = z.retryCreate(fullPath, data, zk.FlagEphemeral, nil)
_, err = z.retryCreate(fullPath, data, zk.FlagEphemeral, z.acl)
if err != nil {
if err != zk.ErrNodeExists {
z.logger.Error(fmt.Sprintf("Failed to acquire lock %s", fullPath), "error", err)
Expand Down Expand Up @@ -383,7 +383,7 @@ func (z *zkDCS) create(path string, val interface{}, flags int32) error {
if err != nil {
return fmt.Errorf("failed to serialize to JSON %#v", val)
}
_, err = z.retryCreate(fullPath, data, flags, nil)
_, err = z.retryCreate(fullPath, data, flags, z.acl)
if err != nil {
if err == zk.ErrNodeExists {
return ErrExists
Expand Down Expand Up @@ -418,7 +418,7 @@ func (z *zkDCS) set(path string, val interface{}, flags int32) error {
if err != nil {
return err
}
_, err = z.retryCreate(fullPath, data, flags, nil)
_, err = z.retryCreate(fullPath, data, flags, z.acl)
if err != nil {
z.logger.Error(fmt.Sprintf("Failed to create node %s with %v", fullPath, val), "error", err)
}
Expand Down
Loading