Motr  M0
m0_rm_remote Struct Reference

#include <rm.h>

Collaboration diagram for m0_rm_remote:
Collaboration graph

Data Fields

enum m0_rm_remote_state rem_state
 
struct m0_rm_resourcerem_resource
 
struct m0_clink rem_rev_sess_clink
 
struct m0_rpc_sessionrem_session
 
struct m0_chan rem_signal
 
struct m0_tlink rem_res_linkage
 
struct m0_cookie rem_cookie
 
struct m0_ref rem_refcnt
 
uint64_t rem_id
 
struct m0_rm_ha_tracker rem_tracker
 
bool rem_dead
 
uint64_t rem_magix
 

Detailed Description

A representation of a resource owner from another domain.

This is a generic structure.

m0_rm_remote is a portal through which interaction with the remote resource owners is transacted. m0_rm_remote state transitions happen under its resource's lock.

A remote owner is needed to borrow from or sub-let to an owner in a different domain. To establish the communication between local and remote owner the following stages are needed:

- a service managing the remote owner must be located in the
  cluster. The particular way to do this depends on a resource type. For
  some resource types, the service is immediately known. For example, a
  "grant" (i.e., a reservation of a free storage space on a data
  service) is provided by the data service, which is already known by
  the time the grant is needed. For such resource types,
  m0_rm_remote::rem_state is initialised to REM_SERVICE_LOCATED. For
  other resource types, a distributed resource location data-base is
  consulted to locate the service. While the data-base query is going
  on, the remote owner is in REM_SERVICE_LOCATING state;

- once the service is known, the owner within the service should be
  located. This is done generically, by sending a resource management fop
  to the service. The service responds with the remote owner identifier
  (m0_rm_remote::rem_cookie) used for further communications. The service
  might respond with an error, if the owner is no longer there. In this
  case, m0_rm_state::rem_state goes back to REM_SERVICE_LOCATING.

  Owner identification is an optional step, intended to optimise remote
  service performance. The service should be able to deal with the
  requests without the owner identifier. Because of this, owner
  identification can be piggy-backed to the first operation on the
  remote owner.
*           fini
*      +----------------INITIALISED
*      |                     |
*      |                     | query the resource data-base
*      |                     |
*      |    TIMEOUT          V
*      +--------------SERVICE_LOCATING<----+
*      |                     |             |
*      |                     | reply: OK   |
*      |                     |             |
*      V    fini             V             |
*    FREED<-----------SERVICE_LOCATED      | reply: moved
*      ^                     |             |
*      |                     | get id      |
*      |                     |             |
*      |    TIMEOUT          V             |
*      +----------------OWNER_LOCATING-----+
*      |                     |
*      |                     | reply: id
*      |                     |
*      |    fini             V
*      +----------------OWNER_LOCATED
*
* 

Definition at line 747 of file rm.h.

Field Documentation

◆ rem_cookie

struct m0_cookie rem_cookie

An identifier of the remote owner within the service. Valid in REM_OWNER_LOCATED state. This identifier is generated by the resource manager service.

Definition at line 768 of file rm.h.

◆ rem_dead

bool rem_dead

When HA has reported remote owner is "dead", this field gets true.

Definition at line 788 of file rm.h.

◆ rem_id

uint64_t rem_id

Definition at line 782 of file rm.h.

◆ rem_magix

uint64_t rem_magix

Definition at line 789 of file rm.h.

◆ rem_refcnt

struct m0_ref rem_refcnt

Reference counter for remote debtor. When the last loan is settled (paid back) and there are no more pending incoming requests, the debtor instance can be freed.

The m0_ref counter is atomic and does not need any protection, but rm_remote_free() called by it needs to be protected against m0_rm_remote_find(resource), so we use res->r_mutex for this.

Note
this should not be used for creditors whose life-cycle does not depend on the number of credited loans.

Definition at line 781 of file rm.h.

◆ rem_res_linkage

struct m0_tlink rem_res_linkage

A linkage into the list of remotes for a given resource hanging off m0_rm_resource::r_remotes.

Definition at line 762 of file rm.h.

◆ rem_resource

struct m0_rm_resource* rem_resource

A resource for which the remote owner is represented.

Definition at line 752 of file rm.h.

◆ rem_rev_sess_clink

struct m0_clink rem_rev_sess_clink

Clink to track reverse session establishing

Definition at line 754 of file rm.h.

◆ rem_session

struct m0_rpc_session* rem_session

Definition at line 755 of file rm.h.

◆ rem_signal

struct m0_chan rem_signal

A channel to signal state changes.

Definition at line 757 of file rm.h.

◆ rem_state

enum m0_rm_remote_state rem_state

Definition at line 748 of file rm.h.

◆ rem_tracker

struct m0_rm_ha_tracker rem_tracker

Used for subscriptions to HA notifications about remote failure.

Definition at line 784 of file rm.h.


The documentation for this struct was generated from the following file: