Cluster Redistribution
Cluster redistribution is an important and time-consuming task after a cluster scale-out. Before the scale-out, service data is centrally distributed on the original nodes. The scale-out adds new empty nodes to the cluster. After the scale-out, the system will redistribute the data on the original nodes to all nodes based on a new distribution policy to ensure even data distribution and optimal query performance. This process is data redistribution, which greatly improves the service response speed.
By default, redistribution is automatically started after cluster scale-out. For enhanced reliability, disable the automatic redistribution function and manually start a redistribution task after the scale-out is successful. In this way, both scale-out and redistribution can be retried upon failures.
DWS supports offline redistribution and online redistribution. The redistribution mode is the same as the scale-out mode. If online scale-out is used for the cluster, online redistribution is also used by default.
Before redistribution starts or when redistribution is paused, you can set redistribution priorities for the tables that have not been redistributed by schema or table.
Notes and Constraints
- The cluster redistribution function is supported in 8.1.1.200 or later cluster versions.
- This function can be manually enabled only when the cluster task information displays To be redistributed after scale-out.
- You can also select the redistribution mode when you configure cluster scale-out (see Configure advanced parameters).
- Redistribution queues are sorted based on the relpage size of tables. To ensure that the relpage size is correct, you are advised to perform the ANALYZE operation on the tables to be redistributed.
- Constraints on offline redistribution are as follows:
- In offline redistribution mode, the database does not support DDL and DCL operations. Tables that are being redistributed support only simple DQL operations.
- During table redistribution, a shared lock is added to tables. All insert, update, and delete operations as well as DDL operations on the tables are blocked for a long time, which may cause a lock wait timeout. Do not perform queries that take more than 20 minutes during the redistribution (the default time for applying for the write lock during redistribution is 20 minutes). Otherwise, data redistribution may fail due to lock wait timeout.
- Constraints on online redistribution are as follows:
- In online redistribution mode, the database supports partial DDL and DCL operations.
- Tables that are being redistributed support insert, delete, and update operations and some DDL operations, including:
- INSERT, DELETE, UPDATE, MERGE INTO, OVERWRITE, UPSERT
- Join queries across node groups
- Local table renaming, schema modification, DROP, TRUNCATE, TRUNCATE-PARTITION
- The following operations cannot be performed on tables that are being redistributed:
- Run ALTER TABLE statements (except for TRUNCATE PARTITION), including adding or deleting columns or partitions.
- Create, modify, or delete indexes.
- Perform VACUUM FULL and CLUSTER operations on tables.
- Modify the sequence objects on which a column depends, including creating and modifying them. Typical statements are CREATE and ALTER SEQUENCE ... OWNED BY.
- During the redistribution of a table with more than 996 columns, UPDATE and DELETE statements cannot be executed. SELECT and INSERT statements are allowed.
- Database and tablespace objects cannot be created, deleted, or modified during redistribution.
- A partition swap can be performed only if the redistribution is complete for both of the tables to be swapped. The two tables belong to different node groups and do not allow partition swap if either of them is being redistributed.
- The function of viewing redistribution details is supported by 8.1.1.200 and later cluster versions. Details about the data table redistribution progress are supported only by 8.2.1 and later cluster versions.
- You can check redistribution details only if the cluster is being redistributed, failed to be redistributed, or is suspended. There may be a delay in the statistics update.
Offline Redistribution
- Log in to the DWS console.
- Choose Cluster > Cluster List. All clusters are displayed by default.
- Locate a cluster, click More in the Operation column, and choose Scale Node > Redistribute.
- Set advanced parameters. You can select Default.
- Redistribution Concurrency: Set it to a number from 1 to 200. The default value is 4.
- Redistribution Mode: Retain the default value Offline.
- Priority: You can click Adjust Priority to adjust the redistribution priority (schema or table dimension). Then redistribution is performed based on the configured sequence.
- Click Next: Confirm.
- Confirm all configurations and click Submit. In the displayed dialog box, click OK to start the redistribution.
Online Redistribution
- Log in to the DWS console.
- Choose Cluster > Cluster List. All clusters are displayed by default.
- Locate a cluster, click More in the Operation column, and choose Scale Node > Redistribute.
- Set advanced parameters and click Custom.
- Redistribution Concurrency: Set it to a number from 1 to 200. The default value is 4.
- Redistribution Mode: Select Online.
- Priority: You can click Adjust Priority to adjust the redistribution priority (schema or table dimension). Then redistribution is performed based on the configured sequence.
- Click Next: Confirm.
- Confirm all configurations and click Submit. In the displayed dialog box, click OK to start the redistribution.
Viewing Redistribution Details
- Log in to the DWS console.
- Choose Cluster > Cluster List. All clusters are displayed by default.
- In the Task Information column of a cluster, click View Details.
- On the View Redistribution Details page, you can check the monitoring information, including the redistribution mode, redistribution progress, and table redistribution details of the current cluster. You can pause and resume redistribution, set the redistribution priority, and change the number of concurrent redistribution tasks.
- Check the redistribution status, configuration, progress, and redistribution details of all the tables in a specified database. To check data table redistribution details, specify a database that can be searched by table redistribution status and table name. If all the tables in a database have completed redistribution, no data will be displayed for the database.
- If the redistribution is triggered when nodes are added to an existing logical cluster, the bucket splitting information after the scale-out is also displayed. Buckets are split so that data can be evenly distributed on all nodes after the redistribution.
- When redistribution is paused, you can set the redistribution priority (in schema or table dimension), and redistribution will be performed based on the configured redistribution sequence. You can also set the redistribution priority before the redistribution starts. Figure 1 Redistribution priority
- The number of concurrent redistribution tasks can be adjusted during redistribution. Clusters running version 8.1.0 or earlier do not support dynamic adjustment. To change the redistribution concurrency, suspend the redistribution first. Figure 2 Redistribution concurrency
- Check the redistribution progress. After the redistribution is complete, the amount of completed data, amount of remaining data, number of completed tables, number of remaining tables, and rate during redistribution are displayed.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot