pub struct StreamHealthResponse {
pub target: Option<Target>,
pub serving: bool,
pub primary_term_start_timestamp: i64,
pub realtime_stats: Option<RealtimeStats>,
pub tablet_alias: Option<TabletAlias>,
}Expand description
StreamHealthResponse is streamed by StreamHealth on a regular basis. It is expected to be used between a vtgate and vttablet:
- target describes the tablet.
- realtime_stats is set.
- aggregate_stats is not set (deprecated)
Fields§
§target: Option<Target>target is the current server type. Only queries with that exact Target record will be accepted (the cell may not match, however).
serving: boolserving is true iff the tablet is serving. A tablet may not be serving if filtered replication is enabled on a primary for instance, or if a replica should not be used because the keyspace is being resharded.
primary_term_start_timestamp: i64primary_term_start_timestamp can be interpreted as the last time we knew that this tablet was promoted to a PRIMARY of this shard (if StreamHealthResponse describes a group of tablets, between two vtgates, only one primary will be present in the group, and this is this primary’s value).
It is used by vtgate when determining the current PRIMARY of a shard. If vtgate sees more than one PRIMARY tablet, this timestamp is used as tiebreaker where the PRIMARY with the highest timestamp wins. Another usage of this timestamp is in go/vt/vtgate/buffer to detect the end of a reparent (failover) and stop buffering.
In practice, this field is set to: a) the last time the RPC tabletmanager.TabletExternallyReparented was called on this tablet (usually done by an external failover tool e.g. Orchestrator). The failover tool can call this as long as we are the primary i.e. even ages after the last reparent occurred. OR b) the last time an active reparent was executed through a vtctl command (InitShardPrimary, PlannedReparentShard, EmergencyReparentShard) OR c) the last time vttablet was started and it initialized its tablet type as PRIMARY because it was recorded as the shard’s current primary in the topology (see go/vt/vttablet/tabletmanager/init_tablet.go) OR d) 0 if the vttablet is not a PRIMARY.
realtime_stats: Option<RealtimeStats>realtime_stats contains information about the tablet status. It is only filled in if the information is about a tablet.
tablet_alias: Option<TabletAlias>tablet_alias is the alias of the sending tablet. The discovery/healthcheck.go code uses it to verify that it’s talking to the correct tablet and that it hasn’t changed in the meantime e.g. due to tablet restarts where ports or ips have been reused but assigned differently.
Trait Implementations§
Source§impl Clone for StreamHealthResponse
impl Clone for StreamHealthResponse
Source§fn clone(&self) -> StreamHealthResponse
fn clone(&self) -> StreamHealthResponse
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StreamHealthResponse
impl Debug for StreamHealthResponse
Source§impl Default for StreamHealthResponse
impl Default for StreamHealthResponse
Source§impl Message for StreamHealthResponse
impl Message for StreamHealthResponse
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self.Source§impl PartialEq for StreamHealthResponse
impl PartialEq for StreamHealthResponse
impl StructuralPartialEq for StreamHealthResponse
Auto Trait Implementations§
impl Freeze for StreamHealthResponse
impl RefUnwindSafe for StreamHealthResponse
impl Send for StreamHealthResponse
impl Sync for StreamHealthResponse
impl Unpin for StreamHealthResponse
impl UnwindSafe for StreamHealthResponse
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request