-
Notifications
You must be signed in to change notification settings - Fork 51
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
KVS: need flux_kvs_move() or flux_kvs_txn_move() #1747
Comments
On 2), I guess it would be two native operations that could appear sequentially in a transaction to represent a move: something like This If |
If I'm thinking this through correctly a We already can unlink in a transaction, so that's done. We have mechanisms in place for kvs transactions to lookup missing references (i.e. the root |
Could it just always copy a directory entry as is, without checking type? Seems like that would work in all cases. And actually maybe |
Ahh you're right, can just copy the entry.
If we want support a native |
I think actually copying a dirent of any type is equivalent to a deep copy. See |
Right now in |
Oh sorry I might have a shallow (so to speak) understanding of commit processing at this point. I just meant the end result of copying a dirent (shallow from the |
I see now, a shallow copy is sufficient b/c it is "deep" from the user perspective looking at the KVS. I'm sure I got confused too :-) |
It just occurred to me, having a native Right now we have a rule that kvs txns can only occur within a single namespace. |
Well, we could stick to the restriction. Would that make it more doable? |
it definitely makes it more doable. Effectively I have to add a Other main thing is right now all kvs transactions are effectively "puts" (regardless if it's a put of a val or dir, that's all encoded in the treeobj). So we'd have to add a "transaction type" kind of field to each transaction operation, so the kvs module can determine it's a "put", "copy", "move" or what not. And obviously for "copy" / "move" we need to add an additional key field for the destination. I don't think the transactions are in any RFC so I don't think we need to update an RFC for this, although maybe we should? |
it's probably also worth mentioning that we would want |
Actually I think since an unlink could be added to a transaction externally, we'd just want to support "copy" (user calls It seems like this is not that easy to get done within the KVS module, and maybe we should just go with the composite future implementation instead (implementing it within libkvs)? At least for now? |
@chu11 were you already working on the libkvs implementations of move and copy? I was playing around with the composite futures and got something working which I'm fine with tossing out if your'e already going on this. LMK, otherwise I'll go ahead and do the work to turn my toy into something better. |
haven't started yet as I've been working on #1651. |
Add flux_kvs_copy() and flux_kvs_move() based on composite futures. flux_kvs_copy() performs: 1) a lookup of the directory entry for the source key 2) a put, commit that sets the destination key to a copy of the dirent. kvs_move() performs: 1) a flux_kvs_copy() 2) an unlink, commit on the source key Fixes flux-framework#1747
The job manager needs a way to move a job from the active to inactive directories. Currently that would be a combination of a snapshot lookup, a put to the new key, and an unlink of the old key. An example exists in
cmd_move()
in theflux-kvs
command.The job manager could simply chain futures for these operations (lookup as one RPC, put + unlink + commit as a second one), but I thought I'd open this issue to consider whether it's a useful function to expose in the API, and which way to implement is best:
I think 2) would be most useful, but I'm not sure how difficult it would be to implement on the KVS module side.
The text was updated successfully, but these errors were encountered: