mon: generic key/value service
mon: ConfigKeyService: stash config keys on the monitor
Building up on the Single-Paxos and our existing k/v store that backs
the monitor, we now introduce a simple service so that the monitors
act as a generic k/v store available to the cluster, in which a user
can stash (and later obtain) configuration keys at his own discretion.
Users can put, get, delete, list and check for values using the
- ceph config-key put <key> [<value>]
- ceph config-key put <key> [-i <in-file>]
with 'value' and 'in-file' being optional; if these are not specified,
'put' will act as 'touch' if 'key' does not exist, or will overwrite
the value of 'key' with a zero byte value (i.e., truncates the
contents of the value to zero)
- ceph config-key get <key>
- ceph config-key get <key> -o <out-file>
- ceph config-key delete <key>
- ceph config-key list [-o <out-file]
- ceph config-key exists <key>
Signed-off-by: Joao Eduardo Luis <email@example.com>
#1 Updated by Joao Eduardo Luis about 6 years ago
- Category set to Monitor
- Status changed from New to Need Review
- Assignee set to Joao Eduardo Luis
Basically, every single piece of code is now being kept on Monitor.cc. It should be moved to a different file, ideally a class inheriting PaxosService, although it really doesn't need the same guarantees as the other PaxosServices.
The whole approach follows the idea that we should be able to read a value from any monitor in the cluster, but we should only stash values through the leader, so we can leverage Paxos to do the actual dissemination of the stashed key:value.
So we have all the write operations being forwarded to the leader, who will encode them in a transaction and submit them to paxos; once all monitors commit, the leader will then reply to the client. By leveraging Paxos this way, we avoid a whole lot of trouble making these values available to all the monitors in the cluster.
I believe the approach is quite simple, and should work as it is -- thorough testing pending the creating of a simple test to perform operations alongside other tests.
Currently supported operations:
- ceph store put <key> <value> or - ceph store put <key> -i <in-file> - ceph store get <key> or - ceph store get <key> -o <out-file> - ceph store delete <key> - ceph store list - ceph store exists <key>
Btw, available @ wip-4313 commit:83ad6a7e8382b75113883f1594d831682fdca503