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

brick_server new client API - copy/6 #18

Open
tatsuya6502 opened this issue Jan 6, 2014 · 1 comment
Open

brick_server new client API - copy/6 #18

tatsuya6502 opened this issue Jan 6, 2014 · 1 comment
Assignees
Milestone

Comments

@tatsuya6502
Copy link
Member

To help a client application to implement "copy on write" snapshot feature, add the following lightweight server-side operations. These operations should be very efficient because they are metadata-only operations and do not have to read/copy the value on a disk.

  • copy/6 - copy the value and user metadata to other key(s).
    • copy(table(), From::key(), To::key(), exp_time(), [do_op_flag()], timeout())
    • copy(table(), From::key(), To::[key()], exp_time(), [do_op_flag()], timeout())

Limitation:

  • From::key() and To:key() must have the same key prefix (they must be stored in the same chain.)

Design Notes:

  • To be a lightweight operation, use in-memory operation ?KEY_SWITCHAROO to copy only the pointer to the value.
  • When an hlog file containing From key is frozen, do not to use ?KEY_SWITCHAROO. Instead, do a disk-based operation; load the value of From key from an hlog on a disk and put the value to To key(s). More details on [Hibari release candidate] bad sequence file 'enoent' on a common log file deleted by the scavenger hibari#33 (comment)
  • Maybe we want remove rename/6 operation from brick_server? The same thing can be done by a micro-transaction: do([txn, copy(OldKey, NewKey), delete(OldKey)]) Note that the current implementation of rename/6 is not an equivalent of the micro-transaction but a simple do operation: do([copy(OldKey, NewKey), delete(OldKey)]) One good thing to keep rename/6 is that it has its own operation counter for the brick operation statistics, but it does not seem to be a must-have feature.
@ghost ghost assigned tatsuya6502 Jan 6, 2014
@tatsuya6502
Copy link
Member Author

Set the target milestone to v0.3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant