MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / propose_metadata

Method propose_metadata

nodedb-cluster/tests/common/test_node.rs:295–301  ·  view source on GitHub ↗

Propose a `MetadataEntry` directly to the metadata Raft group on this node. Fails if this node is not the group-0 leader. This is the path integration tests use to inject replicated DDL without bringing up a pgwire client. Production uses the same underlying `RaftLoop::propose_to_metadata_group`.

(
        &self,
        entry: &nodedb_cluster::MetadataEntry,
    )

Source from the content-addressed store, hash-verified

293 /// DDL without bringing up a pgwire client. Production uses the
294 /// same underlying `RaftLoop::propose_to_metadata_group`.
295 pub fn propose_metadata(
296 &self,
297 entry: &nodedb_cluster::MetadataEntry,
298 ) -> Result<u64, Box<dyn std::error::Error + Send + Sync>> {
299 let bytes = nodedb_cluster::encode_entry(entry)?;
300 Ok(self.raft_loop.propose_to_metadata_group(bytes)?)
301 }
302
303 /// `true` if this node currently believes itself to be the
304 /// leader of the metadata raft group (group 0).

Calls 2

encode_entryFunction · 0.50

Tested by

no test coverage detected