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

add reference id for idempotent refence counter operations #100

Draft
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

xiegeo
Copy link
Contributor

@xiegeo xiegeo commented Jun 17, 2020

WIP (not stable until one stable server-side and client-side implementation)

The basic design for the protocol, server and client sides to be implemented.

When operating on a reference-counted block store, exact once operation is required to keep the count correct. Although exact once operation is trivial when down locally, it is impossible to guaranty over an unreliable network.

This is worked around by adding a nonce (reference id) to each add operation that can only be removed by calling remove on the same nonce. Not only does this make the operations idempotent (we can safely retry the same operation), it can also prevent users from removing other's user's adds.

For example, the s3x client can implement this nonce by hash(client private key | server public key | bucket name | object name). The use of the private key prevents attackers from guessing the hash (and server key prevents cross-server attacks), while bucket and object names allow repeated counts on the same content. Everything is also generated statically so nothing extra needs to be saved for deletion.

Problems

  • The java code generation plugin failed

@xiegeo xiegeo requested a review from bonedaddy June 17, 2020 13:14
@github-actions
Copy link
Contributor

github-actions bot commented Jun 17, 2020

CLA Assistant Lite All Contributors have signed the CLA.

@codecov
Copy link

codecov bot commented Jun 17, 2020

Codecov Report

Merging #100 (7ee9da6) into master (e4ee4ab) will decrease coverage by 2.48%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #100      +/-   ##
==========================================
- Coverage   72.60%   70.12%   -2.47%     
==========================================
  Files           9        9              
  Lines         405      338      -67     
==========================================
- Hits          294      237      -57     
+ Misses         84       74      -10     
  Partials       27       27              
Impacted Files Coverage Δ
go/rep_server_source.go 80.00% <0.00%> (-4.61%) ⬇️
go/rep_client.go 53.34% <0.00%> (-3.58%) ⬇️
go/rep_addr_info.go 85.00% <0.00%> (-2.75%) ⬇️
go/rep_subscription.go 81.42% <0.00%> (-2.28%) ⬇️
go/rep_replication.go 87.50% <0.00%> (-1.78%) ⬇️
go/rep_proto.go 100.00% <0.00%> (ø)
go/dag_service.go 0.00% <0.00%> (ø)
go/rep_sort_bytes.go 100.00% <0.00%> (ø)
go/xtestutils/testutils.go 100.00% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e4ee4ab...7ee9da6. Read the comment docs.

Copy link
Collaborator

@bonedaddy bonedaddy left a comment

Choose a reason for hiding this comment

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

Looks good to me, although I noticed that dag removal doesn't return a count like file removal does

@xiegeo xiegeo requested a review from bonedaddy June 19, 2020 08:18
Copy link
Collaborator

@bonedaddy bonedaddy left a comment

Choose a reason for hiding this comment

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

looks good

@RT-nilPointer
Copy link

I have read the CLA Document and I hereby sign the CLA

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.

3 participants