Motr
M0
|
Detailed functional specification. More...
Data Structures | |
struct | m0_cas_hint |
struct | m0_cas_id |
struct | m0_cas_kv |
struct | m0_cas_kv_vec |
struct | m0_crv |
struct | m0_cas_rec |
struct | m0_cas_recv |
struct | m0_cas_op |
struct | m0_cas_rep |
Macros | |
#define | CRV_F "%" PRIu64 ":%c" |
#define | CRV_P(__crv) m0_crv_ts(__crv).dts_phys, m0_crv_tbs(__crv) ? 'd' : 'a' |
#define | M0_CRV_INIT_NONE ((struct m0_crv) { .crv_encoded = M0_CRV_VER_NONE }) |
#define | M0_XCA_ENUM M0_XC_ATTR("enum", "nonce") |
Enumerations | |
enum | m0_cas_op_flags { COF_SLANT = 1 << 0, COF_CREATE = 1 << 1, COF_OVERWRITE = 1 << 2, COF_CROW = 1 << 3, COF_RESERVE = 1 << 4, COF_DEL_LOCK = 1 << 5, COF_EXCLUDE_START_KEY = 1 << 6, COF_SYNC_WAIT = 1 << 7, COF_SKIP_LAYOUT = 1 << 8, COF_VERSIONED = 1 << 9, COF_SHOW_DEAD = 1 << 10 } |
enum | m0_cas_opcode { CO_GET, CO_PUT, CO_DEL, CO_CUR, CO_REP, CO_GC, CO_MIN, CO_TRUNC, CO_DROP, CO_MEM_PLACE, CO_MEM_FREE, CO_NR } |
enum | m0_cas_type { CT_META, CT_BTREE, CT_DEAD_INDEX, CT_MEM } |
enum | { M0_CRV_TBS = 1L << (sizeof(uint64_t) * CHAR_BIT - 1), M0_CRV_VER_NONE = 0, M0_CRV_VER_MAX = (UINT64_MAX & ~M0_CRV_TBS) - 1, M0_CRV_VER_MIN = M0_CRV_VER_NONE + 1 } |
Functions | |
struct m0_cas_hint | M0_XCA_DOMAIN (rpc) |
struct m0_crv | M0_XCA_DOMAIN (rpc|be) |
M0_INTERNAL void | m0_cas_svc_init (void) |
M0_INTERNAL void | m0_cas_svc_fini (void) |
M0_INTERNAL void | m0_cas_svc_fop_args (struct m0_sm_conf **sm_conf, const struct m0_fom_type_ops **fom_ops, struct m0_reqh_service_type **svctype) |
M0_INTERNAL void | m0_cas__ut_svc_be_set (struct m0_reqh_service *svc, struct m0_be_domain *dom) |
M0_INTERNAL struct m0_be_domain * | m0_cas__ut_svc_be_get (struct m0_reqh_service *svc) |
M0_INTERNAL int | m0_cas_fom_spawn (struct m0_fom *lead, struct m0_fom_thralldom *thrall, struct m0_fop *cas_fop, void(*on_fom_complete)(struct m0_fom_thralldom *, struct m0_fom *)) |
M0_INTERNAL void | m0_cas_id_fini (struct m0_cas_id *cid) |
M0_INTERNAL bool | m0_cas_id_invariant (const struct m0_cas_id *cid) |
M0_INTERNAL bool | cas_in_ut (void) |
M0_INTERNAL void | m0_crv_init (struct m0_crv *crv, const struct m0_dtm0_ts *ts, bool tbs) |
M0_INTERNAL bool | m0_crv_is_none (const struct m0_crv *crv) |
M0_INTERNAL int | m0_crv_cmp (const struct m0_crv *left, const struct m0_crv *right) |
M0_INTERNAL bool | m0_crv_tbs (const struct m0_crv *crv) |
M0_INTERNAL void | m0_crv_tbs_set (struct m0_crv *crv, bool tbs) |
M0_INTERNAL struct m0_dtm0_ts | m0_crv_ts (const struct m0_crv *crv) |
M0_INTERNAL void | m0_crv_ts_set (struct m0_crv *crv, const struct m0_dtm0_ts *ts) |
Variables | |
enum m0_cas_op_flags | M0_XCA_DOMAIN |
enum m0_cas_opcode | M0_XCA_ENUM |
M0_EXTERN struct m0_reqh_service_type | m0_cas_service_type |
M0_EXTERN const struct m0_fid | m0_cas_meta_fid |
M0_EXTERN const struct m0_fid | m0_cas_dead_index_fid |
M0_EXTERN const struct m0_fid | m0_cas_ctidx_fid |
M0_EXTERN const struct m0_fid_type | m0_cas_index_fid_type |
M0_EXTERN const struct m0_fid_type | m0_dix_fid_type |
M0_EXTERN const struct m0_fid_type | m0_cctg_fid_type |
M0_EXTERN struct m0_fop_type | cas_get_fopt |
M0_EXTERN struct m0_fop_type | cas_put_fopt |
M0_EXTERN struct m0_fop_type | cas_del_fopt |
M0_EXTERN struct m0_fop_type | cas_cur_fopt |
M0_EXTERN struct m0_fop_type | cas_rep_fopt |
M0_EXTERN struct m0_fop_type | cas_gc_fopt |
struct m0_fop_type | m0_fop_fsync_cas_fopt |
Detailed functional specification.
#define CRV_P | ( | __crv | ) | m0_crv_ts(__crv).dts_phys, m0_crv_tbs(__crv) ? 'd' : 'a' |
#define M0_CRV_INIT_NONE ((struct m0_crv) { .crv_encoded = M0_CRV_VER_NONE }) |
enum testbitmask M0_XCA_ENUM M0_XC_ATTR("enum", "nonce") |
Definition at line 54 of file xcode_attr.h.
anonymous enum |
enum m0_cas_op_flags |
CAS operation flags.
Enumerator | |
---|---|
COF_SLANT | For NEXT operation, allows iteration to start with the smallest key following the start key if the start key is not found. |
COF_CREATE | For PUT operation, instructs it to be a no-op if the record with the given key already exists. |
COF_OVERWRITE | For PUT operation, instructs it to silently overwrite existing record with the same key, if any. |
COF_CROW | For PUT operation, instructs it to create catalogue on record PUT to non-existent catalogue. For DEL operation, instructs it to be a no-op if catalogue to be deleted does not exist. |
COF_RESERVE | Repair is in progress, reserve space. |
COF_DEL_LOCK | For DEL operation, instructs CAS service to take "delete" lock for the record being deleted. It is used by DIX client to handle delete in degraded mode. |
COF_EXCLUDE_START_KEY | For NEXT operation, instructs it to skip record with the given start key. |
COF_SYNC_WAIT | For PUT/DEL operation, instructs it to delay reply from CAS service until BE transaction is persisted. |
COF_SKIP_LAYOUT | For IDX CREATE, IDX DELETE and IDX LOOKUP operation, instructs it to skip layout update operation. |
COF_VERSIONED | Enables version-aware behavior for PUT, DEL, GET, and NEXT requests. OverviewVersions are taken from m0_cas_op::cg_txd. When this flag is set, the following change happens in the logic of the mentioned request types:
How to enable/disableThis operation mode is enabled only if all the requirements are satisfied (the list above). For example, if m0_cas_op::cg_txd does not have a valid transaction ID then the request is getting executed in the usual manner, without version-aware behavior. Additional restictions may be imposed later on, but at this moment it is as flexible as possible. Relation with DTM0The flag should always be enabled if DTM0 is enabled because it enables CRDT-ness for catalogues. If DTM0 is not enabled then this flag may or may not be enabled (for example, the version-related UTs use the flag but they do not depend on enabled DTM0). |
COF_SHOW_DEAD | Makes NEXT return "dead" records (with tombstones) when version-aware behavior is specified (see COF_VERSIONED). By default, COF_VERSIONED does not return dead records for NEXT requests but when both flags are specified (VERSIONED | SHOW_DEAD) then it yields all records whether they are alive or not. It might be used by the client when it wants to analyse the records received from several catalogue services, so that it could properly merge the results of NEXT operations eliminating inconsistencies. In other words, it might be used in degraded mode. |
enum m0_cas_opcode |
enum m0_cas_type |
M0_INTERNAL bool cas_in_ut | ( | void | ) |
M0_INTERNAL struct m0_be_domain* m0_cas__ut_svc_be_get | ( | struct m0_reqh_service * | svc | ) |
M0_INTERNAL void m0_cas__ut_svc_be_set | ( | struct m0_reqh_service * | svc, |
struct m0_be_domain * | dom | ||
) |
M0_INTERNAL int m0_cas_fom_spawn | ( | struct m0_fom * | lead, |
struct m0_fom_thralldom * | thrall, | ||
struct m0_fop * | cas_fop, | ||
void(*)(struct m0_fom_thralldom *, struct m0_fom *) | on_fom_complete | ||
) |
M0_INTERNAL void m0_cas_id_fini | ( | struct m0_cas_id * | cid | ) |
M0_INTERNAL bool m0_cas_id_invariant | ( | const struct m0_cas_id * | cid | ) |
M0_INTERNAL void m0_cas_svc_fini | ( | void | ) |
M0_INTERNAL void m0_cas_svc_fop_args | ( | struct m0_sm_conf ** | sm_conf, |
const struct m0_fom_type_ops ** | fom_ops, | ||
struct m0_reqh_service_type ** | svctype | ||
) |
M0_INTERNAL void m0_cas_svc_init | ( | void | ) |
CAS server side is able to compile in user-space only. Use stubs in kernel mode for service initialisation and deinitalisation. Also use NULLs for service-specific fields in CAS FOP types.
Definition at line 515 of file service.c.
Compare two versions. Note, tombstones are checked at the end which means that if there are two different operations with the same version (for example, PUT@10 and DEL@10) then the operation that sets the tombstone (DEL@10) is always considered to be "newer" than the other one. It helps to ensure operations have the same order on any server despite the order of execution.
Definition at line 275 of file cas.c.
M0_INTERNAL void m0_crv_init | ( | struct m0_crv * | crv, |
const struct m0_dtm0_ts * | ts, | ||
bool | tbs | ||
) |
M0_INTERNAL bool m0_crv_is_none | ( | const struct m0_crv * | crv | ) |
M0_INTERNAL bool m0_crv_tbs | ( | const struct m0_crv * | crv | ) |
M0_INTERNAL void m0_crv_tbs_set | ( | struct m0_crv * | crv, |
bool | tbs | ||
) |
M0_INTERNAL struct m0_dtm0_ts m0_crv_ts | ( | const struct m0_crv * | crv | ) |
M0_INTERNAL void m0_crv_ts_set | ( | struct m0_crv * | crv, |
const struct m0_dtm0_ts * | ts | ||
) |
struct m0_cas_hint M0_XCA_DOMAIN | ( | rpc | ) |
struct m0_crv M0_XCA_DOMAIN | ( | rpc| | be | ) |
M0_EXTERN struct m0_fop_type cas_cur_fopt |
M0_EXTERN struct m0_fop_type cas_del_fopt |
M0_EXTERN struct m0_fop_type cas_gc_fopt |
M0_EXTERN struct m0_fop_type cas_get_fopt |
M0_EXTERN struct m0_fop_type cas_put_fopt |
M0_EXTERN struct m0_fop_type cas_rep_fopt |
M0_EXTERN const struct m0_fid_type m0_cas_index_fid_type |
M0_EXTERN struct m0_reqh_service_type m0_cas_service_type |
M0_EXTERN const struct m0_fid_type m0_cctg_fid_type |
M0_EXTERN const struct m0_fid_type m0_dix_fid_type |
struct m0_fop_type m0_fop_fsync_cas_fopt |
enum { ... } M0_XCA_DOMAIN |
enum m0_cas_type M0_XCA_ENUM |