Skip to content

Commit

Permalink
chore: rename ceresmeta to horaemeta (#1327)
Browse files Browse the repository at this point in the history
This refers to #1319.

---------

Signed-off-by: tison <wander4096@gmail.com>
Co-authored-by: tison <wander4096@gmail.com>
  • Loading branch information
chunshao90 and tisonkun authored Dec 1, 2023
1 parent 12271ed commit 3a9bd4e
Show file tree
Hide file tree
Showing 15 changed files with 64 additions and 66 deletions.
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,6 @@ env:
RUSTFLAGS: "-C debuginfo=1"
CARGO_TERM_COLOR: always
RUST_BACKTRACE: "1"
CERESMETA_IMAGE_NAME: ceresdb/ceresmeta-server:latest
CERESDB_IMAGE_NAME: ceresdb/ceresdb-server:latest
LOCK_FILE: Cargo.lock
RUST_VERSION: nightly-2023-08-28

Expand Down Expand Up @@ -146,7 +144,7 @@ jobs:
name: CI-${{ github.sha }}
path: |
/tmp/ceresdb-stdout.log
/tmp/ceresmeta.log
/tmp/horaemeta-stdout.log
/tmp/ceresdb-stdout-0.log
/tmp/ceresdb-stdout-1.log
Expand All @@ -172,12 +170,12 @@ jobs:
run: |
sudo apt update
sudo apt install --yes protobuf-compiler
- name: Build and Run CeresDB-Cluster
- name: Build and Run HoraeDB Cluster
working-directory: integration_tests
run: |
make prepare
make run-ceresmeta
make run-ceresdb-cluster
make run-horaemeta
make run-horaedb-cluster
- name: Run Go SDK tests
working-directory: integration_tests
run: |
Expand Down
6 changes: 3 additions & 3 deletions cluster/src/cluster_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ use crate::{
/// ClusterImpl is an implementation of [`Cluster`] based [`MetaClient`].
///
/// Its functions are to:
/// - Handle the some action from the CeresMeta;
/// - Handle the heartbeat between ceresdb-server and CeresMeta;
/// - Handle the some action from the HoraeMeta;
/// - Handle the heartbeat between ceresdb-server and HoraeMeta;
/// - Provide the cluster topology.
pub struct ClusterImpl {
inner: Arc<Inner>,
Expand Down Expand Up @@ -192,7 +192,7 @@ impl Inner {

async fn route_tables(&self, req: &RouteTablesRequest) -> Result<RouteTablesResponse> {
// TODO: we should use self.topology to cache the route result to reduce the
// pressure on the CeresMeta.
// pressure on the HoraeMeta.
let route_resp = self
.meta_client
.route_tables(req.clone())
Expand Down
4 changes: 2 additions & 2 deletions cluster/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

//! Cluster sub-crate includes serval functionalities for supporting CeresDB
//! server to running in the distribute mode. Including:
//! - Request CeresMeta for reading topology or configuration.
//! - Accept CeresMeta's commands like open/close shard or create/drop table
//! - Request HoraeMeta for reading topology or configuration.
//! - Accept HoraeMeta's commands like open/close shard or create/drop table
//! etc.
//!
//! The core types are [Cluster] trait and its implementation [ClusterImpl].
Expand Down
2 changes: 1 addition & 1 deletion integration_tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ceresmeta
horaemeta
22 changes: 11 additions & 11 deletions integration_tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ ROOT = $(shell pwd)
CERESDB_DATA_DIR = /tmp/ceresdb
CERESDB_DATA_DIR_0 = /tmp/ceresdb0
CERESDB_DATA_DIR_1 = /tmp/ceresdb1
CERESMETA_DATA_DIR = /tmp/ceresmeta
HORAEMETA_DATA_DIR = /tmp/horaemeta

export CERESDB_TEST_CASE_PATH ?= $(ROOT)/cases/env
export CERESDB_TEST_BINARY ?= $(ROOT)/../target/$(MODE)/ceresdb-test
Expand All @@ -16,9 +16,9 @@ export CERESDB_STDOUT_FILE ?= /tmp/ceresdb-stdout.log
export CERESDB_CONFIG_FILE ?= $(ROOT)/../docs/minimal.toml

# Environment variables for cluster
export CERESMETA_BINARY_PATH ?= $(ROOT)/ceresmeta/ceresmeta-server
export CERESMETA_CONFIG_PATH ?= $(ROOT)/config/ceresmeta.toml
export CERESMETA_STDOUT_FILE ?= /tmp/ceresmeta-stdout.log
export HORAEMETA_BINARY_PATH ?= $(ROOT)/horaemeta/horaemeta-server
export HORAEMETA_CONFIG_PATH ?= $(ROOT)/config/horaemeta.toml
export HORAEMETA_STDOUT_FILE ?= /tmp/horaemeta-stdout.log
export CERESDB_CONFIG_FILE_0 ?= $(ROOT)/config/ceresdb-cluster-0.toml
export CERESDB_CONFIG_FILE_1 ?= $(ROOT)/config/ceresdb-cluster-1.toml
export CLUSTER_CERESDB_STDOUT_FILE_0 ?= /tmp/ceresdb-stdout-0.log
Expand All @@ -31,7 +31,7 @@ export RUST_BACKTRACE=1
export UPDATE_REPOS_TO_LATEST ?= true

clean:
rm -rf $(CERESDB_DATA_DIR) $(CERESDB_DATA_DIR_0) $(CERESDB_DATA_DIR_1) $(CERESMETA_DATA_DIR)
rm -rf $(CERESDB_DATA_DIR) $(CERESDB_DATA_DIR_0) $(CERESDB_DATA_DIR_1) $(HORAEMETA_DATA_DIR)

build-meta:
./build_meta.sh
Expand All @@ -44,21 +44,21 @@ build-test:

build: build-ceresdb build-test

kill-old-ceresmeta:
killall ceresmeta-server | true
kill-old-horaemeta:
killall horaemeta-server | true

kill-old-ceresdb:
killall ceresdb-server | true

kill-old-process: kill-old-ceresmeta kill-old-ceresdb
kill-old-process: kill-old-horaemeta kill-old-ceresdb

prepare: clean build kill-old-process

run-ceresmeta: build-meta
nohup $(CERESMETA_BINARY_PATH) --config ${CERESMETA_CONFIG_PATH} > /tmp/ceresmeta-stdout.log 2>&1 &
run-horaemeta: build-meta
nohup $(HORAEMETA_BINARY_PATH) --config ${HORAEMETA_CONFIG_PATH} > /tmp/horaemeta-stdout.log 2>&1 &
sleep 10

run-ceresdb-cluster: build-ceresdb
run-horaedb-cluster: build-ceresdb
nohup ${CERESDB_BINARY_PATH} --config ${CERESDB_CONFIG_FILE_0} > ${CLUSTER_CERESDB_STDOUT_FILE_0} 2>&1 &
nohup ${CERESDB_BINARY_PATH} --config ${CERESDB_CONFIG_FILE_1} > ${CLUSTER_CERESDB_STDOUT_FILE_1} 2>&1 &
sleep 30
Expand Down
10 changes: 5 additions & 5 deletions integration_tests/build_meta.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ set -o pipefail
META_BIN_PATH=${META_BIN_PATH:-""}

if [[ -z "${META_BIN_PATH}" ]]; then
echo "Fetch and install ceresmeta-server..."
go install -a github.com/CeresDB/horaemeta/cmd/ceresmeta-server@main
META_BIN_PATH="$(go env GOPATH)/bin/ceresmeta-server"
echo "Fetch and install horaemeta-server..."
go install -a github.com/CeresDB/horaemeta/cmd/horaemeta-server@main
META_BIN_PATH="$(go env GOPATH)/bin/horaemeta-server"
fi

TARGET=$(pwd)/ceresmeta
TARGET=$(pwd)/horaemeta
mkdir -p ${TARGET}
cp ${META_BIN_PATH} ${TARGET}/ceresmeta-server
cp ${META_BIN_PATH} ${TARGET}/horaemeta-server
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ peer-urls = "http://127.0.0.1:2380"
advertise-client-urls = "http://127.0.0.1:2379"
advertise-peer-urls = "http://127.0.0.1:2380"
client-urls = "http://127.0.0.1:2379"
data-dir = "/tmp/ceresmeta"
data-dir = "/tmp/horaemeta"
node-name = "meta0"
initial-cluster = "meta0=http://127.0.0.1:2380"
default-cluster-node-count = 2
Expand Down
42 changes: 21 additions & 21 deletions integration_tests/src/database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ const CERESDB_BINARY_PATH_ENV: &str = "CERESDB_BINARY_PATH";
const CERESDB_STDOUT_FILE_ENV: &str = "CERESDB_STDOUT_FILE";
const CERESDB_CONFIG_FILE_ENV: &str = "CERESDB_CONFIG_FILE";

const CERESMETA_BINARY_PATH_ENV: &str = "CERESMETA_BINARY_PATH";
const CERESMETA_CONFIG_ENV: &str = "CERESMETA_CONFIG_PATH";
const CERESMETA_STDOUT_FILE_ENV: &str = "CERESMETA_STDOUT_FILE";
const HORAEMETA_BINARY_PATH_ENV: &str = "HORAEMETA_BINARY_PATH";
const HORAEMETA_CONFIG_ENV: &str = "HORAEMETA_CONFIG_PATH";
const HORAEMETA_STDOUT_FILE_ENV: &str = "HORAEMETA_STDOUT_FILE";
const CERESDB_CONFIG_FILE_0_ENV: &str = "CERESDB_CONFIG_FILE_0";
const CERESDB_CONFIG_FILE_1_ENV: &str = "CERESDB_CONFIG_FILE_1";
const CLUSTER_CERESDB_STDOUT_FILE_0_ENV: &str = "CLUSTER_CERESDB_STDOUT_FILE_0";
Expand Down Expand Up @@ -72,7 +72,7 @@ pub struct CeresDBServer {
pub struct CeresDBCluster {
server0: CeresDBServer,
server1: CeresDBServer,
ceresmeta_process: Child,
horaemeta_process: Child,

/// Used in meta health check
db_client: Arc<dyn DbClient>,
Expand Down Expand Up @@ -135,23 +135,23 @@ impl CeresDBCluster {
#[async_trait]
impl Backend for CeresDBCluster {
fn start() -> Self {
let ceresmeta_bin =
env::var(CERESMETA_BINARY_PATH_ENV).expect("Cannot parse ceresdb binary path env");
let ceresmeta_config =
env::var(CERESMETA_CONFIG_ENV).expect("Cannot parse ceresmeta config path env");
let ceresmeta_stdout =
env::var(CERESMETA_STDOUT_FILE_ENV).expect("Cannot parse ceresmeta stdout env");
println!("Start ceresmeta at {ceresmeta_bin} with config {ceresmeta_config} and stdout {ceresmeta_stdout}");

let ceresmeta_stdout =
File::create(ceresmeta_stdout).expect("Cannot create ceresmeta stdout");
let ceresmeta_process = std::process::Command::new(&ceresmeta_bin)
.args(["--config", &ceresmeta_config])
.stdout(ceresmeta_stdout)
let horaemeta_bin =
env::var(HORAEMETA_BINARY_PATH_ENV).expect("Cannot parse ceresdb binary path env");
let horaemeta_config =
env::var(HORAEMETA_CONFIG_ENV).expect("Cannot parse horaemeta config path env");
let horaemeta_stdout =
env::var(HORAEMETA_STDOUT_FILE_ENV).expect("Cannot parse horaemeta stdout env");
println!("Start horaemeta at {horaemeta_bin} with config {horaemeta_config} and stdout {horaemeta_stdout}");

let horaemeta_stdout =
File::create(horaemeta_stdout).expect("Cannot create horaemeta stdout");
let horaemeta_process = std::process::Command::new(&horaemeta_bin)
.args(["--config", &horaemeta_config])
.stdout(horaemeta_stdout)
.spawn()
.expect("Failed to spawn process to start server");

println!("wait for ceresmeta ready...\n");
println!("wait for horaemeta ready...\n");
std::thread::sleep(Duration::from_secs(10));

let ceresdb_bin =
Expand Down Expand Up @@ -183,7 +183,7 @@ impl Backend for CeresDBCluster {
Self {
server0,
server1,
ceresmeta_process,
horaemeta_process,
db_client,
meta_stable_check_sql,
}
Expand Down Expand Up @@ -222,9 +222,9 @@ impl Backend for CeresDBCluster {
fn stop(&mut self) {
self.server0.stop();
self.server1.stop();
self.ceresmeta_process
self.horaemeta_process
.kill()
.expect("Failed to kill ceresmeta");
.expect("Failed to kill horaemeta");
}
}

Expand Down
2 changes: 1 addition & 1 deletion interpreters/src/table_manipulator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ pub enum Error {
#[snafu(display("Failed to drop table, msg:{}, err:{}", msg, source))]
DropWithCause { msg: String, source: GenericError },

#[snafu(display("Failed to create partition table without ceresmeta, table:{}", table))]
#[snafu(display("Failed to create partition table without horaemeta, table:{}", table))]
PartitionTableNotSupported { table: String },

#[snafu(display("Failed to operate table, err:{}", source))]
Expand Down
2 changes: 1 addition & 1 deletion meta_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub enum Error {

define_result!(Error);

/// MetaClient is the abstraction of client used to communicate with CeresMeta
/// MetaClient is the abstraction of client used to communicate with HoraeMeta
/// cluster.
#[async_trait]
pub trait MetaClient: Send + Sync {
Expand Down
6 changes: 3 additions & 3 deletions meta_client/src/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ pub struct ShardInfo {
pub id: ShardId,
pub role: ShardRole,
pub version: ShardVersion,
// This status is only used for request ceresdb send to ceresmeta via heartbeat
// This status is only used for request ceresdb send to horaemeta via heartbeat
// When ceresdb receive this via open shard request, this field is meaningless.
// TODO: Use different request and response body between ceresdb and
// ceresmeta.
// horaemeta.
pub status: ShardStatus,
}

Expand Down Expand Up @@ -251,7 +251,7 @@ impl Default for MetaClientConfig {
Self {
cluster_name: String::new(),
meta_addr: "127.0.0.1:8080".to_string(),
meta_members_url: "ceresmeta/members".to_string(),
meta_members_url: "horaemeta/members".to_string(),
lease: ReadableDuration::secs(10),
timeout: ReadableDuration::secs(5),
cq_count: 8,
Expand Down
10 changes: 5 additions & 5 deletions proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,11 +394,11 @@ impl Proxy {
return Ok(());
}

info!("Drop partition table because the id of the table in ceresdb is different from the one in ceresmeta,\
info!("Drop partition table because the id of the table in ceresdb is different from the one in horaemeta,\
catalog_name:{catalog_name}, schema_name:{schema_name}, table_name:{table_name}, old_table_id:{table_id}, new_table_id:{}",
partition_table_info.id);
// Drop partition table because the id of the table in ceresdb is different from
// the one in ceresmeta.
// the one in horaemeta.
self.drop_partition_table(
schema.clone(),
catalog_name.to_string(),
Expand All @@ -408,10 +408,10 @@ impl Proxy {
.await?;
}
(Some(table), None) => {
// Drop partition table because it does not exist in ceresmeta but exists in
// Drop partition table because it does not exist in horaemeta but exists in
// ceresdb-server.
if table.partition_info().is_some() {
info!("Drop partition table because it does not exist in ceresmeta but exists in ceresdb-server,\
info!("Drop partition table because it does not exist in horaemeta but exists in ceresdb-server,\
catalog_name:{catalog_name}, schema_name:{schema_name}, table_name:{table_name}, table_id:{}", table.id());
self.drop_partition_table(
schema.clone(),
Expand Down Expand Up @@ -442,7 +442,7 @@ impl Proxy {
)
.await?;
// Partition table is a virtual table, so we need to create it manually.
// Partition info is stored in ceresmeta, so we need to use create_table_request
// Partition info is stored in horaemeta, so we need to use create_table_request
// to create it.
let params = CreateTableParams {
catalog_name: catalog_name.to_string(),
Expand Down
6 changes: 3 additions & 3 deletions proxy/src/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,8 @@ impl Proxy {
Ok(resp)
}

// Handle write requests based on ceresmeta.
// 1. Create table via ceresmeta if it does not exist.
// Handle write requests based on horaemeta.
// 1. Create table via horaemeta if it does not exist.
// 2. Split write request.
// 3. Process write.
async fn handle_write_with_meta(
Expand Down Expand Up @@ -127,7 +127,7 @@ impl Proxy {
self.collect_write_response(futures).await
}

// Handle write requests without ceresmeta.
// Handle write requests without horaemeta.
// 1. Split write request.
// 2. Create table if not exist.
// 3. Process write.
Expand Down
4 changes: 2 additions & 2 deletions src/ceresdb/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,10 @@ pub struct Config {
/// The cluster deployment decides how to deploy the CeresDB cluster.
///
/// [ClusterDeployment::NoMeta] means to start one or multiple CeresDB
/// instance(s) without CeresMeta.
/// instance(s) without HoraeMeta.
///
/// [ClusterDeployment::WithMeta] means to start one or multiple CeresDB
/// instance(s) under the control of CeresMeta.
/// instance(s) under the control of HoraeMeta.
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(tag = "mode")]
#[allow(clippy::large_enum_variant)]
Expand Down
2 changes: 1 addition & 1 deletion table_engine/src/engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ pub struct EngineRuntimes {
pub write_runtime: RuntimeRef,
/// Runtime for compacting data
pub compact_runtime: RuntimeRef,
/// Runtime for ceresmeta communication
/// Runtime for horaemeta communication
pub meta_runtime: RuntimeRef,
/// Runtime for some other tasks which are not so important
pub default_runtime: RuntimeRef,
Expand Down

0 comments on commit 3a9bd4e

Please sign in to comment.