-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #279 from ethpandaops/feat/migrations-sharding
feat(deploy/migrations): add replacing merge trees fix
- Loading branch information
Showing
2 changed files
with
119 additions
and
0 deletions.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
deploy/migrations/clickhouse/027_fix_replacing_tables_sharding_keys.down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
DROP TABLE IF EXISTS canonical_beacon_block on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block on cluster '{cluster}' AS canonical_beacon_block_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_local, rand()); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_block_proposer_slashing on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block_proposer_slashing on cluster '{cluster}' AS canonical_beacon_block_proposer_slashing_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_proposer_slashing_local, rand()); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_block_attester_slashing on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block_attester_slashing on cluster '{cluster}' AS canonical_beacon_block_attester_slashing_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_attester_slashing_local, rand()); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_block_bls_to_execution_change on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block_bls_to_execution_change on cluster '{cluster}' AS canonical_beacon_block_bls_to_execution_change_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_bls_to_execution_change_local, rand()); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_block_execution_transaction on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block_execution_transaction on cluster '{cluster}' AS canonical_beacon_block_execution_transaction_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_execution_transaction_local, rand()); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_block_voluntary_exit on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block_voluntary_exit on cluster '{cluster}' AS canonical_beacon_block_voluntary_exit_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_voluntary_exit_local, rand()); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_block_deposit on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block_deposit on cluster '{cluster}' AS canonical_beacon_block_deposit_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_deposit_local, rand()); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_block_withdrawal on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block_withdrawal on cluster '{cluster}' AS canonical_beacon_block_withdrawal_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_withdrawal_local, rand()); | ||
|
||
DROP TABLE IF EXISTS beacon_block_classification on cluster '{cluster}' SYNC; | ||
CREATE TABLE beacon_block_classification on cluster '{cluster}' AS beacon_block_classification_local | ||
ENGINE = Distributed('{cluster}', default, beacon_block_classification_local, rand()); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_blob_sidecar on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_blob_sidecar on cluster '{cluster}' AS canonical_beacon_blob_sidecar_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_blob_sidecar_local, rand()); | ||
|
||
DROP TABLE IF EXISTS mempool_dumpster_transaction on cluster '{cluster}' SYNC; | ||
CREATE TABLE mempool_dumpster_transaction on cluster '{cluster}' AS mempool_dumpster_transaction_local | ||
ENGINE = Distributed('{cluster}', default, mempool_dumpster_transaction_local, rand()); | ||
|
||
DROP TABLE IF EXISTS block_native_mempool_transaction on cluster '{cluster}' SYNC; | ||
CREATE TABLE block_native_mempool_transaction on cluster '{cluster}' AS block_native_mempool_transaction_local | ||
ENGINE = Distributed('{cluster}', default, block_native_mempool_transaction_local, rand()); | ||
|
||
DROP TABLE IF EXISTS beacon_p2p_attestation on cluster '{cluster}' SYNC; | ||
CREATE TABLE beacon_p2p_attestation on cluster '{cluster}' AS beacon_p2p_attestation_local | ||
ENGINE = Distributed('{cluster}', default, beacon_p2p_attestation_local, rand()); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_proposer_duty on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_proposer_duty on cluster '{cluster}' AS canonical_beacon_proposer_duty_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_proposer_duty_local, rand()); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_elaborated_attestation on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_elaborated_attestation on cluster '{cluster}' AS canonical_beacon_elaborated_attestation_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_elaborated_attestation_local, rand()); |
60 changes: 60 additions & 0 deletions
60
deploy/migrations/clickhouse/027_fix_replacing_tables_sharding_keys.up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
DROP TABLE IF EXISTS canonical_beacon_block on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block on cluster '{cluster}' AS canonical_beacon_block_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_local, cityHash64(slot_start_date_time, meta_network_name)); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_block_proposer_slashing on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block_proposer_slashing on cluster '{cluster}' AS canonical_beacon_block_proposer_slashing_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_proposer_slashing_local, cityHash64(slot_start_date_time, unique_key, meta_network_name)); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_block_attester_slashing on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block_attester_slashing on cluster '{cluster}' AS canonical_beacon_block_attester_slashing_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_attester_slashing_local, cityHash64(slot_start_date_time, unique_key, meta_network_name)); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_block_bls_to_execution_change on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block_bls_to_execution_change on cluster '{cluster}' AS canonical_beacon_block_bls_to_execution_change_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_bls_to_execution_change_local, cityHash64(slot_start_date_time, unique_key, meta_network_name)); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_block_execution_transaction on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block_execution_transaction on cluster '{cluster}' AS canonical_beacon_block_execution_transaction_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_execution_transaction_local, cityHash64(slot_start_date_time, unique_key, meta_network_name)); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_block_voluntary_exit on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block_voluntary_exit on cluster '{cluster}' AS canonical_beacon_block_voluntary_exit_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_voluntary_exit_local, cityHash64(slot_start_date_time, unique_key, meta_network_name)); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_block_deposit on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block_deposit on cluster '{cluster}' AS canonical_beacon_block_deposit_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_deposit_local, cityHash64(slot_start_date_time, unique_key, meta_network_name)); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_block_withdrawal on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_block_withdrawal on cluster '{cluster}' AS canonical_beacon_block_withdrawal_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_block_withdrawal_local, cityHash64(slot_start_date_time, unique_key, meta_network_name)); | ||
|
||
DROP TABLE IF EXISTS beacon_block_classification on cluster '{cluster}' SYNC; | ||
CREATE TABLE beacon_block_classification on cluster '{cluster}' AS beacon_block_classification_local | ||
ENGINE = Distributed('{cluster}', default, beacon_block_classification_local, cityHash64(slot_start_date_time, meta_network_name)); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_blob_sidecar on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_blob_sidecar on cluster '{cluster}' AS canonical_beacon_blob_sidecar_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_blob_sidecar_local, cityHash64(slot_start_date_time, unique_key, meta_network_name)); | ||
|
||
DROP TABLE IF EXISTS mempool_dumpster_transaction on cluster '{cluster}' SYNC; | ||
CREATE TABLE mempool_dumpster_transaction on cluster '{cluster}' AS mempool_dumpster_transaction_local | ||
ENGINE = Distributed('{cluster}', default, mempool_dumpster_transaction_local, cityHash64(timestamp, unique_key, chain_id)); | ||
|
||
DROP TABLE IF EXISTS block_native_mempool_transaction on cluster '{cluster}' SYNC; | ||
CREATE TABLE block_native_mempool_transaction on cluster '{cluster}' AS block_native_mempool_transaction_local | ||
ENGINE = Distributed('{cluster}', default, block_native_mempool_transaction_local, cityHash64(detecttime, unique_key, network)); | ||
|
||
DROP TABLE IF EXISTS beacon_p2p_attestation on cluster '{cluster}' SYNC; | ||
CREATE TABLE beacon_p2p_attestation on cluster '{cluster}' AS beacon_p2p_attestation_local | ||
ENGINE = Distributed('{cluster}', default, beacon_p2p_attestation_local, cityHash64(slot_start_date_time, unique_key, meta_network_name)); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_proposer_duty on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_proposer_duty on cluster '{cluster}' AS canonical_beacon_proposer_duty_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_proposer_duty_local, cityHash64(slot_start_date_time, unique_key, meta_network_name)); | ||
|
||
DROP TABLE IF EXISTS canonical_beacon_elaborated_attestation on cluster '{cluster}' SYNC; | ||
CREATE TABLE canonical_beacon_elaborated_attestation on cluster '{cluster}' AS canonical_beacon_elaborated_attestation_local | ||
ENGINE = Distributed('{cluster}', default, canonical_beacon_elaborated_attestation_local, cityHash64(slot_start_date_time, unique_key, meta_network_name)); | ||
|