Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[yugabyted] Send database migrations metadata for visualisation in yugabyted UI #1002

Open
gargsans-yb opened this issue Aug 23, 2023 · 0 comments
Assignees
Labels
triage Needs to be triaged

Comments

@gargsans-yb
Copy link
Contributor

Create and
As users start the process of migrations using Voyager, users should be able to review the complexity of the migrations and the progress of each migration at any given time. Yugabyted UI should be able to provide a dashboard to allow the users to effectively plan the migrations based on the complexity and also be able to monitor the progress of each migration.

Yugabyted UI will provide the visualization for the Voyager workflow. Following are the steps users will go through when migrating to YugabyteDB -

Step 1: Overall Migration assessment of the Source DB
Step 2: Schema migration
Step 3: finalize schema migration
Step 4: data migration
Step 5: cutover/failback for app traffic

Metadata regarding each step in voyager should be sent to the target DB. The metadata table schema:

CREATE TABLE IF NOT EXISTS ybvoyager_visualizer.ybvoyager_visualizer_metadata (
			migration_uuid UUID,
			migration_phase INT,
			invocation_sequence INT,
			database_name VARCHAR(250),
			schema_name VARCHAR(250),
			payload TEXT,
			status VARCHAR(30),
			invocation_timestamp TIMESTAMPTZ,
			PRIMARY KEY (migration_uuid, migration_phase, invocation_sequence)
			);

payload will contain the report generated at the ANALYZE SCHEMA step.

For EXPORT DATA and IMPORT DATA steps, send the metrics for EXPORT/IMPORT completion for each table. The metrics table:

CREATE TABLE IF NOT EXISTS ybvoyager_visualizer.ybvoyager_visualizer_table_metrics (
			migration_uuid UUID,
			table_name VARCHAR(250),
			schema_name VARCHAR(250),
			migration_phase INT,
			status INT,
			count_live_rows INT,
			count_total_rows INT,
			invocation_timestamp TIMESTAMPTZ,
			PRIMARY KEY (migration_uuid, table_name, migration_phase, schema_name)
			);

There will be an entry for each table that is being IMPORTED/EXPORTED and the entry is updated every 5 secs.

@gargsans-yb gargsans-yb self-assigned this Aug 23, 2023
@github-actions github-actions bot added the triage Needs to be triaged label Aug 23, 2023
gargsans-yb added a commit to gargsans-yb/yb-voyager that referenced this issue Aug 23, 2023
… target yugabyteDB.

Summary:

* Set the ENV variable `TARGET_YBDB_CONN_URI` before running any voyager command for visualisation in yugabyted-UI. Example: export TARGET_YBDB_CONN_URI=postgresql://yugabyte:yugabyte@10.150.1.230:5433
* For each of the following voyager steps, metadata is being sent to target DB in the ybvoyager_visualizer.ybvoyager_visualizer_metadata table:
   - EXPORT SCHEMA
   - ANALYZE SCHEMA
   - EXPORT DATA
   - IMPORT SCHEMA
   - IMPORT DATA
* For EXPORT DATA and IMPORT DATA steps, table completetion metrics are sent to the ybvoyager_visualizer.ybvoyager_visualizer_table_metrics.
* Table metrics are sent every 5 secs.

Test Plan: Manual Testing

Reviewers: nchandrappa, amit-yb, sanyamsinghal

Subscribers: gargsans-yb
gargsans-yb added a commit to gargsans-yb/yb-voyager that referenced this issue Aug 23, 2023
… target yugabyteDB.

Summary:

* Set the ENV variable `TARGET_YBDB_CONN_URI` before running any voyager command for visualisation in yugabyted-UI. Example: export TARGET_YBDB_CONN_URI=postgresql://yugabyte:yugabyte@10.150.1.230:5433
* For each of the following voyager steps, metadata is being sent to target DB in the ybvoyager_visualizer.ybvoyager_visualizer_metadata table:
   - EXPORT SCHEMA
   - ANALYZE SCHEMA
   - EXPORT DATA
   - IMPORT SCHEMA
   - IMPORT DATA
* For EXPORT DATA and IMPORT DATA steps, table completetion metrics are sent to the ybvoyager_visualizer.ybvoyager_visualizer_table_metrics.
* Table metrics are sent every 5 secs.

Test Plan: Manual Testing

Reviewers: nchandrappa, amit-yb, sanyamsinghal

Subscribers: gargsans-yb
gargsans-yb added a commit to gargsans-yb/yb-voyager that referenced this issue Aug 23, 2023
Summary: Made changes so that code does not exit if VisualizerYugabyteDB.conn is not initialized.
gargsans-yb added a commit that referenced this issue Aug 29, 2023
…yugabyteDB.

Summary:

* Set the ENV variable `TARGET_YBDB_CONN_URI` before running any voyager command for visualisation in yugabyted-UI. Example: export TARGET_YBDB_CONN_URI=postgresql://yugabyte:yugabyte@10.150.1.230:5433
* For each of the following voyager steps, metadata is being sent to target DB in the ybvoyager_visualizer.ybvoyager_visualizer_metadata table:
   - EXPORT SCHEMA
   - ANALYZE SCHEMA
   - EXPORT DATA
   - IMPORT SCHEMA
   - IMPORT DATA
* For EXPORT DATA and IMPORT DATA steps, table completetion metrics are sent to the ybvoyager_visualizer.ybvoyager_visualizer_table_metrics.
* Table metrics are sent every 5 secs.

Test Plan: Manual Testing

Reviewers: nchandrappa, amit-yb, sanyamsinghal

Subscribers: gargsans-yb
gargsans-yb added a commit that referenced this issue Aug 29, 2023
Summary: Made changes so that code does not exit if VisualizerYugabyteDB.conn is not initialized.
gargsans-yb added a commit that referenced this issue Aug 31, 2023
…yugabyteDB.

Summary:

* Set the ENV variable `TARGET_YBDB_CONN_URI` before running any voyager command for visualisation in yugabyted-UI. Example: export TARGET_YBDB_CONN_URI=postgresql://yugabyte:yugabyte@10.150.1.230:5433
* For each of the following voyager steps, metadata is being sent to target DB in the ybvoyager_visualizer.ybvoyager_visualizer_metadata table:
   - EXPORT SCHEMA
   - ANALYZE SCHEMA
   - EXPORT DATA
   - IMPORT SCHEMA
   - IMPORT DATA
* For EXPORT DATA and IMPORT DATA steps, table completetion metrics are sent to the ybvoyager_visualizer.ybvoyager_visualizer_table_metrics.
* Table metrics are sent every 5 secs.

Test Plan: Manual Testing

Reviewers: nchandrappa, amit-yb, sanyamsinghal

Subscribers: gargsans-yb
gargsans-yb added a commit that referenced this issue Aug 31, 2023
Summary: Made changes so that code does not exit if VisualizerYugabyteDB.conn is not initialized.
gargsans-yb added a commit that referenced this issue Aug 31, 2023
Summary: Made changes to add `complexity` and `db_type` columns to the visualization metadata table.
`complexity` column will be populated by the apiserver of yugabyted UI. `db_type` will send the
source DB Type for `EXPORT` steps.
gargsans-yb added a commit that referenced this issue Sep 4, 2023
…yugabyteDB.

Summary:

* Set the ENV variable `TARGET_YBDB_CONN_URI` before running any voyager command for visualisation in yugabyted-UI. Example: export TARGET_YBDB_CONN_URI=postgresql://yugabyte:yugabyte@10.150.1.230:5433
* For each of the following voyager steps, metadata is being sent to target DB in the ybvoyager_visualizer.ybvoyager_visualizer_metadata table:
   - EXPORT SCHEMA
   - ANALYZE SCHEMA
   - EXPORT DATA
   - IMPORT SCHEMA
   - IMPORT DATA
* For EXPORT DATA and IMPORT DATA steps, table completetion metrics are sent to the ybvoyager_visualizer.ybvoyager_visualizer_table_metrics.
* Table metrics are sent every 5 secs.

Test Plan: Manual Testing

Reviewers: nchandrappa, amit-yb, sanyamsinghal

Subscribers: gargsans-yb
gargsans-yb added a commit that referenced this issue Sep 4, 2023
Summary: Made changes so that code does not exit if VisualizerYugabyteDB.conn is not initialized.
gargsans-yb added a commit that referenced this issue Sep 4, 2023
Summary: Made changes to add `complexity` and `db_type` columns to the visualization metadata table.
`complexity` column will be populated by the apiserver of yugabyted UI. `db_type` will send the
source DB Type for `EXPORT` steps.
gargsans-yb added a commit that referenced this issue Sep 4, 2023
…yugabyteDB.

Summary:

* Set the ENV variable `TARGET_YBDB_CONN_URI` before running any voyager command for visualisation in yugabyted-UI. Example: export TARGET_YBDB_CONN_URI=postgresql://yugabyte:yugabyte@10.150.1.230:5433
* For each of the following voyager steps, metadata is being sent to target DB in the ybvoyager_visualizer.ybvoyager_visualizer_metadata table:
   - EXPORT SCHEMA
   - ANALYZE SCHEMA
   - EXPORT DATA
   - IMPORT SCHEMA
   - IMPORT DATA
* For EXPORT DATA and IMPORT DATA steps, table completetion metrics are sent to the ybvoyager_visualizer.ybvoyager_visualizer_table_metrics.
* Table metrics are sent every 5 secs.

Test Plan: Manual Testing

Reviewers: nchandrappa, amit-yb, sanyamsinghal

Subscribers: gargsans-yb
gargsans-yb added a commit that referenced this issue Sep 4, 2023
Summary: Made changes so that code does not exit if VisualizerYugabyteDB.conn is not initialized.
gargsans-yb added a commit that referenced this issue Sep 4, 2023
Summary: Made changes to add `complexity` and `db_type` columns to the visualization metadata table.
`complexity` column will be populated by the apiserver of yugabyted UI. `db_type` will send the
source DB Type for `EXPORT` steps.
gargsans-yb added a commit that referenced this issue Sep 4, 2023
Summary: Inserting visualizer metadata differently since payload can contain special escape
characters.
gargsans-yb added a commit that referenced this issue Sep 6, 2023
…yugabyteDB.

Summary:

* Set the ENV variable `TARGET_YBDB_CONN_URI` before running any voyager command for visualisation in yugabyted-UI. Example: export TARGET_YBDB_CONN_URI=postgresql://yugabyte:yugabyte@10.150.1.230:5433
* For each of the following voyager steps, metadata is being sent to target DB in the ybvoyager_visualizer.ybvoyager_visualizer_metadata table:
   - EXPORT SCHEMA
   - ANALYZE SCHEMA
   - EXPORT DATA
   - IMPORT SCHEMA
   - IMPORT DATA
* For EXPORT DATA and IMPORT DATA steps, table completetion metrics are sent to the ybvoyager_visualizer.ybvoyager_visualizer_table_metrics.
* Table metrics are sent every 5 secs.

Test Plan: Manual Testing

Reviewers: nchandrappa, amit-yb, sanyamsinghal

Subscribers: gargsans-yb
gargsans-yb added a commit that referenced this issue Sep 6, 2023
Summary: Made changes so that code does not exit if VisualizerYugabyteDB.conn is not initialized.
gargsans-yb added a commit that referenced this issue Sep 6, 2023
Summary: Made changes to add `complexity` and `db_type` columns to the visualization metadata table.
`complexity` column will be populated by the apiserver of yugabyted UI. `db_type` will send the
source DB Type for `EXPORT` steps.
gargsans-yb added a commit that referenced this issue Sep 6, 2023
Summary: Inserting visualizer metadata differently since payload can contain special escape
characters.
gargsans-yb added a commit that referenced this issue Sep 7, 2023
…yugabyteDB.

Summary:

* Set the ENV variable `TARGET_YBDB_CONN_URI` before running any voyager command for visualisation in yugabyted-UI. Example: export TARGET_YBDB_CONN_URI=postgresql://yugabyte:yugabyte@10.150.1.230:5433
* For each of the following voyager steps, metadata is being sent to target DB in the ybvoyager_visualizer.ybvoyager_visualizer_metadata table:
   - EXPORT SCHEMA
   - ANALYZE SCHEMA
   - EXPORT DATA
   - IMPORT SCHEMA
   - IMPORT DATA
* For EXPORT DATA and IMPORT DATA steps, table completetion metrics are sent to the ybvoyager_visualizer.ybvoyager_visualizer_table_metrics.
* Table metrics are sent every 5 secs.

Test Plan: Manual Testing

Reviewers: nchandrappa, amit-yb, sanyamsinghal

Subscribers: gargsans-yb
gargsans-yb added a commit that referenced this issue Sep 7, 2023
Summary: Made changes so that code does not exit if VisualizerYugabyteDB.conn is not initialized.
gargsans-yb added a commit that referenced this issue Sep 7, 2023
Summary: Made changes to add `complexity` and `db_type` columns to the visualization metadata table.
`complexity` column will be populated by the apiserver of yugabyted UI. `db_type` will send the
source DB Type for `EXPORT` steps.
gargsans-yb added a commit that referenced this issue Sep 7, 2023
Summary: Inserting visualizer metadata differently since payload can contain special escape
characters.
gargsans-yb added a commit that referenced this issue Sep 7, 2023
Summary:
Changing the code structure:
* Creating a interface ControlPlane.
* Implementing this interface through yugabyted. This will be used to handle any voyager event.
* Implementing various events.
gargsans-yb added a commit that referenced this issue Sep 8, 2023
…yugabyteDB.

Summary:

* Set the ENV variable `TARGET_YBDB_CONN_URI` before running any voyager command for visualisation in yugabyted-UI. Example: export TARGET_YBDB_CONN_URI=postgresql://yugabyte:yugabyte@10.150.1.230:5433
* For each of the following voyager steps, metadata is being sent to target DB in the ybvoyager_visualizer.ybvoyager_visualizer_metadata table:
   - EXPORT SCHEMA
   - ANALYZE SCHEMA
   - EXPORT DATA
   - IMPORT SCHEMA
   - IMPORT DATA
* For EXPORT DATA and IMPORT DATA steps, table completetion metrics are sent to the ybvoyager_visualizer.ybvoyager_visualizer_table_metrics.
* Table metrics are sent every 5 secs.

Test Plan: Manual Testing

Reviewers: nchandrappa, amit-yb, sanyamsinghal

Subscribers: gargsans-yb
gargsans-yb added a commit that referenced this issue Sep 8, 2023
Summary: Made changes so that code does not exit if VisualizerYugabyteDB.conn is not initialized.
gargsans-yb added a commit that referenced this issue Sep 8, 2023
Summary: Made changes to add `complexity` and `db_type` columns to the visualization metadata table.
`complexity` column will be populated by the apiserver of yugabyted UI. `db_type` will send the
source DB Type for `EXPORT` steps.
gargsans-yb added a commit that referenced this issue Sep 8, 2023
Summary: Inserting visualizer metadata differently since payload can contain special escape
characters.
gargsans-yb added a commit that referenced this issue Jan 24, 2024
Summary:
* Changed event `SubmitSchemaAnalysisReport` to `SchemaAnalysisIterationCompleted`
* Changed the event `SchemaAnalysisIterationCompleted` to take an object of `AnalysisReport` instead general `payload`.
* yugabyted `payload` is generated using `AnalysisReport` object in the yugabyted implementation of control plane.
gargsans-yb added a commit that referenced this issue Jan 24, 2024
Summary:
* Changed each event in ControlPlane to follow the format: `SomeActionPerformed(*SomeActionPerformedEvent)`
* Created a `eventPublisher` and `rowCountUpdateEventPublisher` to add an event to the queue and publish them.
* Shifted the WaitGroup to `yugabyted` implementation of the controlPlane.
* Shifted the wait for 5 secs for sending tableMetrics(rowCountUpdateEvent) to `yugabyted` implementation.
gargsans-yb added a commit that referenced this issue Feb 2, 2024
…yugabyteDB.

Summary:

* Set the ENV variable `TARGET_YBDB_CONN_URI` before running any voyager command for visualisation in yugabyted-UI. Example: export TARGET_YBDB_CONN_URI=postgresql://yugabyte:yugabyte@10.150.1.230:5433
* For each of the following voyager steps, metadata is being sent to target DB in the ybvoyager_visualizer.ybvoyager_visualizer_metadata table:
   - EXPORT SCHEMA
   - ANALYZE SCHEMA
   - EXPORT DATA
   - IMPORT SCHEMA
   - IMPORT DATA
* For EXPORT DATA and IMPORT DATA steps, table completetion metrics are sent to the ybvoyager_visualizer.ybvoyager_visualizer_table_metrics.
* Table metrics are sent every 5 secs.

Test Plan: Manual Testing

Reviewers: nchandrappa, amit-yb, sanyamsinghal

Subscribers: gargsans-yb
gargsans-yb added a commit that referenced this issue Feb 2, 2024
Summary: Made changes so that code does not exit if VisualizerYugabyteDB.conn is not initialized.
gargsans-yb added a commit that referenced this issue Feb 2, 2024
Summary: Made changes to add `complexity` and `db_type` columns to the visualization metadata table.
`complexity` column will be populated by the apiserver of yugabyted UI. `db_type` will send the
source DB Type for `EXPORT` steps.
gargsans-yb added a commit that referenced this issue Feb 2, 2024
Summary: Inserting visualizer metadata differently since payload can contain special escape
characters.
gargsans-yb added a commit that referenced this issue Feb 2, 2024
Summary:
Changing the code structure:
* Creating a interface ControlPlane.
* Implementing this interface through yugabyted. This will be used to handle any voyager event.
* Implementing various events.
gargsans-yb added a commit that referenced this issue Feb 2, 2024
Summary: Changes to fix go build errors.
gargsans-yb added a commit that referenced this issue Feb 2, 2024
Summary: Code changes to make an initial entry for all tables with their total size during the
import data step.
gargsans-yb added a commit that referenced this issue Feb 2, 2024
Summary: Fixing some errors after merging with latest commits.
gargsans-yb added a commit that referenced this issue Feb 2, 2024
Summary:
* Changed event `SubmitSchemaAnalysisReport` to `SchemaAnalysisIterationCompleted`
* Changed the event `SchemaAnalysisIterationCompleted` to take an object of `AnalysisReport` instead general `payload`.
* yugabyted `payload` is generated using `AnalysisReport` object in the yugabyted implementation of control plane.
gargsans-yb added a commit that referenced this issue Feb 2, 2024
Summary:
* Changed each event in ControlPlane to follow the format: `SomeActionPerformed(*SomeActionPerformedEvent)`
* Created a `eventPublisher` and `rowCountUpdateEventPublisher` to add an event to the queue and publish them.
* Shifted the WaitGroup to `yugabyted` implementation of the controlPlane.
* Shifted the wait for 5 secs for sending tableMetrics(rowCountUpdateEvent) to `yugabyted` implementation.
gargsans-yb added a commit that referenced this issue Feb 2, 2024
Summary:
* Created `initBaseSourceEvent` and `initBaseTargetEvent` to initialise the BaseEvent.
* Added constant identifiers to use the status for Row Count Update.
gargsans-yb added a commit that referenced this issue Feb 5, 2024
…yugabyteDB.

Summary:

* Set the ENV variable `TARGET_YBDB_CONN_URI` before running any voyager command for visualisation in yugabyted-UI. Example: export TARGET_YBDB_CONN_URI=postgresql://yugabyte:yugabyte@10.150.1.230:5433
* For each of the following voyager steps, metadata is being sent to target DB in the ybvoyager_visualizer.ybvoyager_visualizer_metadata table:
   - EXPORT SCHEMA
   - ANALYZE SCHEMA
   - EXPORT DATA
   - IMPORT SCHEMA
   - IMPORT DATA
* For EXPORT DATA and IMPORT DATA steps, table completetion metrics are sent to the ybvoyager_visualizer.ybvoyager_visualizer_table_metrics.
* Table metrics are sent every 5 secs.

Test Plan: Manual Testing

Reviewers: nchandrappa, amit-yb, sanyamsinghal

Subscribers: gargsans-yb
gargsans-yb added a commit that referenced this issue Feb 5, 2024
Summary: Made changes so that code does not exit if VisualizerYugabyteDB.conn is not initialized.
gargsans-yb added a commit that referenced this issue Feb 5, 2024
Summary: Made changes to add `complexity` and `db_type` columns to the visualization metadata table.
`complexity` column will be populated by the apiserver of yugabyted UI. `db_type` will send the
source DB Type for `EXPORT` steps.
gargsans-yb added a commit that referenced this issue Feb 5, 2024
Summary: Inserting visualizer metadata differently since payload can contain special escape
characters.
gargsans-yb added a commit that referenced this issue Feb 5, 2024
Summary:
Changing the code structure:
* Creating a interface ControlPlane.
* Implementing this interface through yugabyted. This will be used to handle any voyager event.
* Implementing various events.
gargsans-yb added a commit that referenced this issue Feb 5, 2024
Summary: Changes to fix go build errors.
gargsans-yb added a commit that referenced this issue Feb 5, 2024
Summary: Code changes to make an initial entry for all tables with their total size during the
import data step.
gargsans-yb added a commit that referenced this issue Feb 5, 2024
Summary: Fixing some errors after merging with latest commits.
gargsans-yb added a commit that referenced this issue Feb 5, 2024
Summary:
* Changed event `SubmitSchemaAnalysisReport` to `SchemaAnalysisIterationCompleted`
* Changed the event `SchemaAnalysisIterationCompleted` to take an object of `AnalysisReport` instead general `payload`.
* yugabyted `payload` is generated using `AnalysisReport` object in the yugabyted implementation of control plane.
gargsans-yb added a commit that referenced this issue Feb 5, 2024
Summary:
* Changed each event in ControlPlane to follow the format: `SomeActionPerformed(*SomeActionPerformedEvent)`
* Created a `eventPublisher` and `rowCountUpdateEventPublisher` to add an event to the queue and publish them.
* Shifted the WaitGroup to `yugabyted` implementation of the controlPlane.
* Shifted the wait for 5 secs for sending tableMetrics(rowCountUpdateEvent) to `yugabyted` implementation.
gargsans-yb added a commit that referenced this issue Feb 5, 2024
Summary:
* Created `initBaseSourceEvent` and `initBaseTargetEvent` to initialise the BaseEvent.
* Added constant identifiers to use the status for Row Count Update.
gargsans-yb added a commit that referenced this issue Feb 5, 2024
Summary:
* Added stack trace for panic handling.
* Using one Mutex to syncronize the YugabyteD code path.
* Added non-blocking channels for publishing migration events.
gargsans-yb added a commit that referenced this issue Feb 5, 2024
…isation through yugabyted-ui. (#1018)

Summary:

Control Plane:
* A new interface called `ControlPlane` added.
* Added all migration events' structs. 
* To initialise a control plane, set the ENV variable `CONTROL_PLANE_TYPE`. Eg: `export CONTROL_PLANE_TYPE=yugabyted`
* If no value is set for `CONTROL_PLANE_TYPE`, a `No-op control plane` will be initialised.

Yugabyted:
* Added the `yugabyted` implementation of `ControlPlane`.
* To initialise the cp with YugabyteD instance, set the following ENV variables:
```
export CONTROL_PLANE_TYPE=yugabyted
export YUGABYTED_DB_CONN_STRING=<postgres_connection_string>
```
* All migration events metadata is sent to yugabyted db under the table `ybvoyager_visualizer.ybvoyager_visualizer_metadata`
* For data migration steps, migrated row count metrics are sent to `ybvoyager_visualizer.ybvoyager_visualizer_table_metrics`
* For each migration event, start and completed events are sent to the yugabyted db.
* Table metrics are sent every 5 secs.

Test Plan: Manual Testing

Reviewers: nchandrappa, amit-yb, sanyamsinghal

Reviewed By: amit-yb

Subscribers: gargsans-yb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs to be triaged
Projects
None yet
Development

No branches or pull requests

1 participant