Parameter rollback method and device of cloud native database and electronic equipment

By encapsulating parameter adjustment tasks as custom resource objects in a cloud-native database, generating rollback snapshots, and distributing adjustments layer by layer, the problem of coarse-grained parameter rollback is solved, achieving second-level recovery and state consistency, thus improving operational efficiency.

CN121807968APending Publication Date: 2026-04-07JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-26
Publication Date
2026-04-07

AI Technical Summary

Technical Problem

Existing technologies have coarse-grained issues in adjusting and rolling back parameters in cloud-native databases, resulting in long recovery times, high risk of business interruption, and difficulty in achieving parameter consistency.

Method used

By encapsulating parameter adjustment tasks into custom resource objects, generating parameter rollback snapshots, and distributing adjustment operations layer by layer according to parameter type and effective layer identifier, and performing layered rollback when a failure is detected, the parameters are restored to their old values.

Benefits of technology

It achieves precise rollback with single parameters, second-level recovery time, reduces the risk of business interruption, ensures state consistency, and enhances the autonomous operation and maintenance capabilities of cloud-native databases.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121807968A_ABST
    Figure CN121807968A_ABST
Patent Text Reader

Abstract

The invention relates to a parameter rollback method and device of a cloud native database and electronic equipment. The method comprises the following steps: packaging a parameter adjustment task into a user-defined resource object, and determining old parameter values, target parameter values, database components to which all parameters to be adjusted in the user-defined resource object belong and parameter effective layer identifiers; for each to-be-adjusted parameter, generating a parameter rollback snapshot, and writing the parameter rollback snapshot into a state field of the user-defined resource object; for each to-be-adjusted parameter, issuing a target parameter value to at least one of a configuration resource layer, a container configuration file layer and a database memory layer corresponding to the to-be-adjusted parameter layer by layer; and when it is detected that the adjustment of the target to-be-adjusted parameter fails, according to the parameter effective layer identifier recorded in the parameter rollback snapshot of the target to-be-adjusted parameter, executing a hierarchical rollback operation to recover the target to-be-adjusted parameter to a corresponding old parameter value. The technical problem that parameter rollback coarseness is difficult to be accurate and consistent is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of distributed database parameter management technology, and in particular to a parameter rollback method, apparatus, and electronic device for cloud-native databases. Background Technology

[0002] With the development of cloud-native technologies, containerization, microservices, and declarative interfaces have become core paradigms for distributed system design. Container orchestration platforms such as Kubernetes enable elastic scaling and automated operation and maintenance of resources. In this architecture, distributed databases, as critical infrastructure, are containerized (Pods) to achieve agile deployment and intelligent scheduling, enabling database components to run efficiently in multi-tenant cloud environments. Operations personnel typically dynamically adjust database parameters using Kubernetes custom resource objects, such as modifying the connection limit or buffer pool size, to meet changes in business load. However, existing technologies still have significant shortcomings in parameter adjustment and rollback. Traditional full-package rollback methods are coarse-grained; when parameter adjustment fails or causes performance fluctuations, only the entire parameter template can be rolled back, triggering a cluster-level rolling restart, resulting in long recovery times and a high risk of business interruption. Furthermore, because parameters take effect at multiple levels—ConfigMap, container configuration files, and database memory—existing technologies cannot accurately identify the failure level. Manual rollback is prone to omissions and may cause state inconsistencies, lacking consistency guarantees for the final state, further increasing the risk of subsequent operation and maintenance tasks and potentially triggering cascading failures. Summary of the Invention

[0003] This application provides a parameter rollback method, apparatus, and electronic device for cloud-native databases to solve the technical problem of coarse-grained and difficult-to-accurate parameter rollback.

[0004] Firstly, this application provides a parameter rollback method for cloud-native databases, comprising: encapsulating a received user-submitted parameter adjustment task into a custom resource object, and determining the old parameter value, target parameter value, database component to which it belongs, and parameter effectiveness layer identifier for all parameters to be adjusted in the custom resource object; generating a parameter rollback snapshot for each parameter to be adjusted and writing it into the status field of the custom resource object, wherein the parameter rollback snapshot includes a parameter identifier, old parameter value, target parameter value, and parameter effectiveness layer identifier; and for each parameter to be adjusted, determining its parameter type and database component to which it belongs, and then... The target parameter value is distributed layer by layer to at least one of the corresponding configuration resource layer, container configuration file layer, and database memory layer to perform parameter adjustment operations. If the adjustment of the target parameter to be adjusted fails, a layered rollback operation is performed according to the parameter effective layer identifier recorded in the parameter rollback snapshot of the target parameter to be adjusted to restore the target parameter to be adjusted to the corresponding old parameter value. After the layered rollback operation is completed, the status field of the custom resource object is updated to indicate that the rollback of the target parameter to be adjusted is complete. The target parameter to be adjusted is any one of the parameters to be adjusted.

[0005] Secondly, this application provides a parameter rollback device for a cloud-native database, comprising: a determination module, used to encapsulate a received user-submitted parameter adjustment task into a custom resource object, and determine the old parameter value, target parameter value, database component to which it belongs, and parameter effectiveness layer identifier of all parameters to be adjusted in the custom resource object; a generation module, used to generate a parameter rollback snapshot for each parameter to be adjusted, and write it into the status field of the custom resource object, wherein the parameter rollback snapshot includes a parameter identifier, old parameter value, target parameter value, and parameter effectiveness layer identifier; and an adjustment module, used to adjust each parameter to be adjusted according to its parameter type and the data to which it belongs. The library component distributes its target parameter value layer by layer to at least one of its corresponding configuration resource layer, container configuration file layer, and database memory layer to perform parameter adjustment operations. The first rollback module is used to perform a layered rollback operation based on the parameter effective layer identifier recorded in the parameter rollback snapshot of the target parameter to be adjusted, in the case of detection of target parameter adjustment failure, to restore the target parameter to be adjusted to the corresponding old parameter value, and after completing the layered rollback operation, update the status field of the custom resource object to indicate that the target parameter to be adjusted has been rolled back. The target parameter to be adjusted is any one of all parameters to be adjusted.

[0006] As an optional example, the first rollback module mentioned above includes: a first rollback unit, used to call the Kubernetes API interface when the parameter effective layer of the target parameter to be adjusted is identified as the configuration resource layer, and to write the key-value pair data of the target parameter to be adjusted in the configuration resource layer back to the old parameter value recorded in the parameter rollback snapshot of the target parameter to be adjusted from the target parameter value of the target parameter to be adjusted.

[0007] As an optional example, the first rollback module includes a second rollback unit, which is used to send a parameter rollback instruction to the Pod corresponding to the database component to which the target parameter to be adjusted belongs when the parameter effective layer of the target parameter to be adjusted is identified as the container configuration file layer, so as to modify the line content of the target parameter to be adjusted in the configuration file from the target parameter value of the target parameter to the old parameter value recorded in the parameter rollback snapshot of the target parameter to be adjusted inside the container.

[0008] As an optional example, the first rollback module includes a third rollback unit, which connects to the target database process when the parameter effective layer of the target parameter to be adjusted is identified as the database memory layer, so as to restore the running value in memory of the target parameter to be adjusted from the target parameter value of the target parameter to the old parameter value recorded in the parameter rollback snapshot of the target parameter to be adjusted.

[0009] As an optional example, the first rollback module includes a recording unit, which is used to write a status record of the rollback completion of the target parameter to be adjusted into the status field of the custom resource object after the above-mentioned hierarchical rollback operation is completed, and to record the parameter identifier, rollback completion timestamp and the reason for triggering the rollback operation in the status record.

[0010] As an optional example, the above apparatus further includes: a deletion module, configured to, for each parameter to be adjusted, according to its parameter type and the database component to which it belongs, distribute its target parameter value layer by layer to at least one of the corresponding configuration resource layer, container configuration file layer, and database memory layer to perform parameter adjustment operation, and after detecting that the target parameter to be adjusted has been successfully adjusted, delete the parameter rollback snapshot of the target parameter to be adjusted in the status field of the custom resource object; and a marking module, configured to mark the lifecycle status of the parameter adjustment task of the target parameter to be adjusted as normal completion in the custom resource object.

[0011] As an optional example, the above apparatus further includes: a second rollback module, configured to, when detecting a rollback indication for a specific parameter to be adjusted added by an operations and maintenance personnel in the annotation portion of the above-mentioned custom resource object, perform a layered rollback operation based on the parameter effective layer identifier recorded in the parameter rollback snapshot of the specific parameter to be adjusted, so as to restore the specific parameter to be adjusted to the corresponding old parameter value, wherein the specific parameter to be adjusted is any one of all parameters to be adjusted.

[0012] Thirdly, this application provides a storage medium storing a computer program, wherein the computer program is executed by a processor to perform the above-mentioned parameter rollback method for cloud-native databases.

[0013] Fourthly, this application also provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-described cloud-native database parameter rollback method through the computer program.

[0014] The technical solutions provided in this application have the following advantages compared with the prior art: This application employs a method of encapsulating received user-submitted parameter adjustment tasks into a custom resource object, and determining the old parameter values, target parameter values, associated database components, and parameter activation layer identifiers for all parameters to be adjusted within the custom resource object. For each parameter to be adjusted, a parameter rollback snapshot is generated and written to the status field of the custom resource object. The parameter rollback snapshot includes the parameter identifier, old parameter value, target parameter value, and parameter activation layer identifier. For each parameter to be adjusted, based on its parameter type and associated database component, its target parameter value is progressively distributed to at least one of the corresponding configuration resource layer, container configuration file layer, and database memory layer to perform parameter adjustment operations. If the adjustment of the target parameter fails, a layered rollback operation is performed based on the parameter activation layer identifier recorded in the parameter rollback snapshot of the target parameter to restore the target parameter to its corresponding old value. The method involves encapsulating the user-submitted parameter adjustment task into a custom resource object, generating a rollback snapshot for each parameter and writing it into the status field. The adjustment is then distributed layer by layer to the configuration resource layer, container configuration file layer, or database memory layer based on the parameter type and its database component. In the event of a parameter adjustment failure, a layered rollback is performed based on the effective layer information of the rollback snapshot, and the status field is updated to ensure consistency between the custom resource object and the actual parameter status. This achieves precise single-parameter rollback, second-level recovery time targets, and status consistency, improving the autonomous operation and maintenance capabilities and security of cloud-native databases. Ultimately, this solves the technical problem of coarse-grained and difficult-to-accurate parameter rollback. Attached Figure Description

[0015] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0016] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0017] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.

[0018] Figure 1 This is a flowchart of an optional parameter rollback method for a cloud-native database according to an embodiment of this application; Figure 2 This is a flowchart illustrating the implementation of an optional parameter rollback method for cloud-native databases according to an embodiment of this application. Figure 3 This is a schematic diagram of the structure of an optional cloud-native database parameter rollback device according to an embodiment of this application; Figure 4 This is a schematic diagram of an optional electronic device according to an embodiment of this application. Detailed Implementation

[0019] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0020] The following disclosure provides numerous different embodiments or examples for implementing various structures of this application. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of this application. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.

[0021] According to a first aspect of the embodiments of this application, a parameter rollback method for cloud-native databases is provided, optionally, as follows: Figure 1 As shown, the above method includes: S102, encapsulate the received user-submitted parameter adjustment task into a custom resource object, and determine the old parameter value, target parameter value, database component to which it belongs, and parameter effective layer identifier of all parameters to be adjusted in the custom resource object; S104. For each parameter to be adjusted, generate a parameter rollback snapshot and write it to the status field of the custom resource object. The parameter rollback snapshot includes the parameter identifier, the old parameter value, the target parameter value, and the parameter effective layer identifier. S106. For each parameter to be adjusted, based on its parameter type and the database component to which it belongs, the target parameter value is sent down layer by layer to at least one of the corresponding configuration resource layer, container configuration file layer and database memory layer to perform parameter adjustment operation. S108, if the target parameter to be adjusted fails to be adjusted, perform a layered rollback operation based on the parameter effective layer identifier recorded in the parameter rollback snapshot of the target parameter to be adjusted, so as to restore the target parameter to be adjusted to the corresponding old parameter value, and after the layered rollback operation is completed, update the status field of the custom resource object to indicate that the rollback of the target parameter to be adjusted is complete, wherein the target parameter to be adjusted is any one of the parameters to be adjusted.

[0022] Optionally, this embodiment proposes a parameter rollback method for cloud-native distributed databases. Its core lies in achieving fine-grained rollback control of individual parameters, improving operational automation and database autonomy. It is applicable to Kubernetes-based cloud-native distributed database architectures, where database components are containerized and run within Pods, and parameters may take effect at the configuration resource layer, container configuration file layer, or database memory layer. Users can submit custom resource objects through Kubernetes to adjust database parameters, such as the connection limit or buffer pool size. The specific implementation process is as follows... Figure 2 As shown: First, the user defines the parameters to be adjusted and their target values ​​using a YAML file, and marks the task type as `adjustParams`. Then, the user submits the parameter adjustment task request to the cluster via the Kubernetes command-line tool. When the system receives the user's submitted parameter adjustment task, it encapsulates the task into a custom resource object and parses the parameter list within it. For each parameter to be adjusted, its old parameter value, target parameter value, associated database component, and parameter effectiveness layer identifier are determined, thus establishing an accurate baseline for rollback operations. Subsequently, a parameter rollback snapshot is generated for each parameter to be adjusted. The snapshot includes the parameter identifier, old parameter value, target parameter value, and parameter effectiveness layer identifier, and is written to the status field of the custom resource object. This step ensures that the rollback baseline is captured before the parameters actually take effect, providing a basis for subsequent fine-grained rollbacks.

[0023] During the parameter tuning execution phase, the system, based on the parameter type and its associated database component, distributes the target parameter value layer by layer to at least one of the corresponding configuration resource layer, container configuration file layer, and database memory layer to perform the parameter tuning operation. For example, for the configuration resource layer, the system performs an overwrite update through the corresponding Kubernetes API interface; for the container configuration file layer, the operations controller performs a configuration file replacement operation within the Pod, modifying the parameter value from the old value to the target value; for the database memory layer, the system executes a runtime parameter reset command through the database client protocol, which takes effect without restarting the database process. The parameter tuning executor returns the effectiveness status of each parameter to determine whether the parameter has been successfully applied.

[0024] When a target parameter adjustment failure is detected, the system executes the corresponding layered rollback operation based on the parameter's effective layer identifier recorded in the rollback snapshot. Layered rollback includes configuration resource layer rollback, container configuration file layer rollback, and database memory layer rollback. For example, at the configuration resource layer, the operations controller restores the parameter value from the target value to the old value via the Kubernetes API; at the container configuration file layer, the operations controller modifies the configuration file within the Pod corresponding to the target database component to restore the parameter value to the old value; at the database memory layer, the system restores the runtime parameter to the old value via the database client protocol. After the rollback is complete, the operations controller updates the status field of the custom resource object, writing the rollback completion identifier, rollback timestamp, and operation reason, thereby ensuring that the declarative final state of the custom resource object is consistent with the actual running state, facilitating subsequent auditing and traceability.

[0025] Optionally, this embodiment breaks away from the traditional full-package rollback mode, refining the rollback granularity to individual parameters and achieving a second-level recovery time target, significantly reducing the risk of business interruption. Simultaneously, the layered driver and state machine closed-loop design ensures that no parameters are missed during rollback operations and that the state remains consistent, greatly enhancing the autonomous operation and maintenance capabilities of cloud-native databases. It can be directly applied in standard Kubernetes clusters, supporting the full lifecycle management of GoldenDB Operator and cloud database instances, providing a secure, reliable, and intelligent parameter management solution for database operation and maintenance in multi-tenant environments.

[0026] As an optional example, a tiered rollback operation is performed based on the parameter effective layer identifier recorded in the parameter rollback snapshot of the target parameter to be adjusted, to restore the target parameter to its corresponding old parameter value, including: If the parameter effective layer of the target parameter to be adjusted is identified as the configuration resource layer, the Kubernetes API interface is called to overwrite the old parameter value recorded in the parameter rollback snapshot of the target parameter to be adjusted from the target parameter value in the configuration resource layer.

[0027] Optionally, in this embodiment, when the adjustment of the target parameter to be adjusted fails, the system performs a layered rollback operation based on the parameter's effective layer identifier recorded in the parameter rollback snapshot to restore the parameter to its corresponding old value. For the rollback operation at the configuration resource layer, the system first determines that the effective layer of the target parameter to be adjusted is the configuration resource layer. Then, the operations controller calls the Kubernetes application programming interface to overwrite the key-value pair data of the parameter in the configuration resource layer from the target parameter value back to the old parameter value recorded in the parameter rollback snapshot, thereby restoring the baseline state of the cluster configuration. During this process, the system can accurately locate the effective layer of the parameter, avoiding accidental operations on other unaffected parameters or components, thus improving the accuracy and security of the rollback. Simultaneously, the rollback operation can be completed without restarting the database component, ensuring continuous database availability.

[0028] As an optional example, a tiered rollback operation is performed based on the parameter effective layer identifier recorded in the parameter rollback snapshot of the target parameter to be adjusted, to restore the target parameter to its corresponding old parameter value, including: If the parameter effective layer of the target parameter to be adjusted is identified as the container configuration file layer, a parameter rollback instruction is sent to the Pod corresponding to the database component to which the target parameter to be adjusted belongs. This is done inside the container to modify the line content of the target parameter to be adjusted in the configuration file from the target parameter value back to the old parameter value recorded in the parameter rollback snapshot of the target parameter to be adjusted.

[0029] Optionally, in this embodiment, when the adjustment of the target parameter to be adjusted fails, the system will perform a layered rollback operation based on the parameter effective layer identifier recorded in the parameter rollback snapshot to restore the parameter to its corresponding old value. For the rollback operation at the container configuration file layer, the system first determines that the effective layer of the target parameter to be adjusted is the container configuration file layer, and then the operations controller sends a parameter rollback command to the Pod corresponding to the database component to which the parameter belongs. Inside the Pod, the rollback command locates the line containing the target parameter in the container's configuration file and modifies the parameter value from the target parameter value back to the old parameter value recorded in the parameter rollback snapshot, thereby restoring the parameter configuration state within the container. This process ensures that only the specified parameter is rolled back, without affecting other unadjusted parameters, and takes effect without restarting the database process, thus guaranteeing the continuous availability of the database component.

[0030] As an optional example, a tiered rollback operation is performed based on the parameter effective layer identifier recorded in the parameter rollback snapshot of the target parameter to be adjusted, to restore the target parameter to its corresponding old parameter value, including: If the parameter effective layer of the target parameter to be adjusted is identified as the database memory layer, connect to the target database process to restore the running value in memory of the target parameter to be adjusted from the target parameter value of the target parameter to the old parameter value recorded in the parameter rollback snapshot of the target parameter to be adjusted.

[0031] Optionally, in this embodiment, when the adjustment of the target parameter to be adjusted fails, the system will perform a layered rollback operation based on the parameter effective layer identifier recorded in the parameter rollback snapshot to restore the parameter to the corresponding old parameter value. For the rollback operation at the database memory layer, the system first determines that the effective layer of the target parameter to be adjusted is the database memory layer, and then connects to the target database process through the operations and maintenance controller to directly modify the runtime parameter value in the database memory, restoring the parameter from the target parameter value to the old parameter value recorded in the parameter rollback snapshot. This operation takes effect without restarting the database process, thereby ensuring the continuous availability of the database component and avoiding the long-term business interruption caused by traditional full-package rollback.

[0032] As an optional example, after completing the tiered rollback operation, updating the status field of the custom resource object to indicate that the rollback of the target parameters to be adjusted has been completed includes: After completing the layered rollback operation, write the status record of the target parameter to be adjusted to the status field of the custom resource object. The status record also records the parameter identifier of the target parameter to be adjusted, the rollback completion timestamp, and the reason for triggering the rollback.

[0033] Optionally, in this embodiment, as Figure 2 The flowchart shown illustrates the implementation process. After a layered rollback operation is completed, the system updates the status field of the custom resource object to indicate that the rollback of the target parameter to be adjusted has been completed. Specifically, the operations controller writes a rollback completion status record to the status field of the custom resource object. This status record includes the identifier of the target parameter to be adjusted, the timestamp of the rollback completion, and the reason for triggering the rollback, thus achieving complete recording and traceability of the rollback operation. Recording rollback information in the status field not only reflects the actual result of the parameter being restored to its old value in different effective layers, but also provides an accurate basis for subsequent operations and maintenance tasks, avoiding misoperations or cascading failures caused by inconsistent status.

[0034] In addition, the system can automatically generate operation logs, recording in detail the execution process of each layered rollback, including parameter names, original values, rollback values, rollback time, and the reason for the operation, providing complete data support for auditing, operation and maintenance monitoring, and anomaly troubleshooting. Updates to status fields ensure that the declarative management characteristics of custom resource objects are maintained, enabling the database management system to achieve a high degree of consistency between parameter status and actual operating status at the cluster level.

[0035] As an optional example, after for each parameter to be adjusted, the target parameter value is distributed layer by layer to at least one of the corresponding configuration resource layer, container configuration file layer, and database memory layer according to its parameter type and the database component to which it belongs, in order to perform parameter adjustment operations, the above method further includes: If the target parameter to be adjusted is successfully adjusted, delete the parameter rollback snapshot of the target parameter to be adjusted from the status field of the custom resource object; In the custom resource object, mark the lifecycle status of the parameter adjustment task for the target parameter to be adjusted as normal completion.

[0036] Optionally, in this embodiment, as Figure 2 The flowchart shown illustrates the specific implementation process. When the system detects that the target parameter to be adjusted has been successfully adjusted—meaning the parameter has taken effect correctly and no anomalies have occurred—the operations controller automatically deletes the corresponding parameter rollback snapshot from the status field of the custom resource object to release storage resources and avoid redundant data accumulation. Simultaneously, the system marks the target parameter's adjustment task lifecycle status as normally completed in the custom resource object, indicating that the parameter has been adjusted and reached the expected state. This mechanism ensures that the status information of the custom resource object remains consistent with the actual operating state of the database, achieving final state consistency under declarative management.

[0037] As an optional example, the above method also includes: When a rollback instruction for a specific parameter to be adjusted, added by an operations and maintenance personnel, is detected in the comment section of a custom resource object, a layered rollback operation is performed based on the parameter effective layer identifier recorded in the parameter rollback snapshot of the specific parameter to be adjusted, so as to restore the specific parameter to be adjusted to the corresponding old parameter value. Here, the specific parameter to be adjusted is any one of the parameters to be adjusted.

[0038] Optionally, in this embodiment, the system supports not only automatic rollback mechanisms but also manual intervention by operations and maintenance personnel. When the system detects a rollback instruction for a specific parameter to be adjusted added by operations and maintenance personnel in the comment section of a custom resource object, the operations and maintenance controller will immediately respond to the instruction and perform a precise rollback operation for the parameter specified in the comment. Specifically, the system first parses the parameter effectiveness layer identifier recorded in the parameter rollback snapshot for the specific parameter to be adjusted to determine the specific location where the parameter takes effect in the configuration resource layer, container configuration file layer, or database memory layer. Subsequently, the system performs the corresponding layered rollback operation according to the effectiveness layer information: in the configuration resource layer, the parameter is restored from the target value to the old value recorded in the rollback snapshot via the Kubernetes API; in the container configuration file layer, a rollback instruction is sent to the Pod corresponding to the target database component, and the configuration file is modified within the container to restore the parameter to the old value; in the database memory layer, the runtime parameter value is restored to the old value via the database client protocol, which takes effect without restarting the database process.

[0039] This manual rollback operation is only executed for the specific parameters specified in the comments, avoiding impact on other parameters that are functioning normally, thus achieving precise control over a single parameter. While executing the rollback operation, the operations controller records the rollback completion status in the status field of the custom resource object, including the parameter identifier, rollback completion timestamp, and the reason for triggering the rollback. This ensures that the declarative state of the resource object is consistent with the actual operating state of the database and provides a reliable basis for auditing and tracing.

[0040] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.

[0041] According to another aspect of the embodiments of this application, a parameter rollback device for cloud-native databases is also provided, such as... Figure 3 As shown, it includes: The determination module 302 is used to encapsulate the received user-submitted parameter adjustment task into a custom resource object, and determine the old parameter value, target parameter value, database component to which it belongs, and parameter effective layer identifier of all parameters to be adjusted in the custom resource object; The generation module 304 is used to generate a parameter rollback snapshot for each parameter to be adjusted and write it into the status field of the custom resource object. The parameter rollback snapshot includes the parameter identifier, the old parameter value, the target parameter value, and the parameter effective layer identifier. The adjustment module 306 is used to, for each parameter to be adjusted, according to its parameter type and the database component to which it belongs, send its target parameter value layer by layer to at least one of the corresponding configuration resource layer, container configuration file layer and database memory layer, so as to perform parameter adjustment operation on it; The first rollback module 308 is used to perform a layered rollback operation based on the parameter effective layer identifier recorded in the parameter rollback snapshot of the target parameter to be adjusted when the adjustment of the target parameter to be adjusted fails. This restores the target parameter to be adjusted to the corresponding old parameter value. After the layered rollback operation is completed, the status field of the custom resource object is updated to indicate that the rollback of the target parameter to be adjusted is complete. The target parameter to be adjusted is any one of the parameters to be adjusted.

[0042] It should be noted that the determining module 302 in this embodiment can be used to execute step S102 in this application embodiment, the generating module 304 in this embodiment can be used to execute step S104 in this application embodiment, the adjusting module 306 in this embodiment can be used to execute step S106 in this application embodiment, and the first rollback module 308 in this embodiment can be used to execute step S108 in this application embodiment.

[0043] As an optional example, the first rollback module includes: The first rollback unit is used to call the Kubernetes API interface when the parameter effective layer of the target parameter to be adjusted is identified as the configuration resource layer. The key-value pair data of the target parameter to be adjusted in the configuration resource layer is written back to the old parameter value recorded in the parameter rollback snapshot of the target parameter to be adjusted, from the target parameter value of the target parameter to be adjusted.

[0044] As an optional example, the first rollback module includes: The second rollback unit is used to send a parameter rollback instruction to the Pod corresponding to the database component to which the target parameter to be adjusted belongs when the parameter effective layer of the target parameter to be adjusted is identified as the container configuration file layer. This instruction modifies the line content of the target parameter to be adjusted in the configuration file from the target parameter value back to the old parameter value recorded in the parameter rollback snapshot of the target parameter to be adjusted inside the container.

[0045] As an optional example, the first rollback module includes: The third rollback unit is used to connect to the target database process when the parameter effective layer of the target parameter to be adjusted is identified as the database memory layer, so as to restore the running value in memory of the target parameter to be adjusted from the target parameter value of the target parameter to the old parameter value recorded in the parameter rollback snapshot of the target parameter to be adjusted.

[0046] As an optional example, the first rollback module includes: The recording unit is used to write the status record of the target parameter to be adjusted to the status field of the custom resource object after the hierarchical rollback operation is completed. The status record records the parameter identifier of the target parameter to be adjusted, the rollback completion timestamp, and the reason for triggering the rollback operation.

[0047] As an optional example, the above-described apparatus further includes: The deletion module is used to, for each parameter to be adjusted, according to its parameter type and the database component to which it belongs, send its target parameter value layer by layer to at least one of the corresponding configuration resource layer, container configuration file layer and database memory layer to perform parameter adjustment operation, and after detecting that the target parameter to be adjusted has been successfully adjusted, delete the parameter rollback snapshot of the target parameter to be adjusted in the status field of the custom resource object. The tagging module is used to mark the lifecycle status of the parameter adjustment task of the target parameter to be adjusted in the custom resource object as normally completed.

[0048] As an optional example, the above-described apparatus further includes: The second rollback module is used to perform a layered rollback operation based on the parameter effective layer identifier recorded in the parameter rollback snapshot of the specific parameter to be adjusted when a rollback instruction for a specific parameter to be adjusted, which was added by the operation and maintenance personnel, is detected in the annotation part of the custom resource object. This is to restore the specific parameter to be adjusted to the corresponding old parameter value. The specific parameter to be adjusted is any one of the parameters to be adjusted.

[0049] For other examples of this embodiment, please refer to the examples above, which will not be repeated here.

[0050] Figure 4 This is a schematic diagram of an optional electronic device according to an embodiment of this application, such as... Figure 4 As shown, it includes a processor 402, a communication interface 404, a memory 406, and a communication bus 408. The processor 402, communication interface 404, and memory 406 communicate with each other via the communication bus 408. Memory 406 is used to store computer programs; When processor 402 executes a computer program stored in memory 406, it performs the following steps: The received user-submitted parameter adjustment task is encapsulated into a custom resource object, and the old parameter value, target parameter value, database component, and parameter effective layer identifier of all parameters to be adjusted in the custom resource object are determined. For each parameter to be adjusted, a parameter rollback snapshot is generated and written to the status field of the custom resource object. The parameter rollback snapshot includes the parameter identifier, the old parameter value, the target parameter value, and the parameter effective layer identifier. For each parameter to be adjusted, based on its parameter type and the database component to which it belongs, its target parameter value is distributed layer by layer to at least one of the corresponding configuration resource layer, container configuration file layer, and database memory layer to perform parameter adjustment operations. If the adjustment of the target parameter to be adjusted fails, a layered rollback operation is performed based on the parameter effective layer identifier recorded in the parameter rollback snapshot of the target parameter to be adjusted, so as to restore the target parameter to be adjusted to the corresponding old parameter value. After the layered rollback operation is completed, the status field of the custom resource object is updated to indicate that the rollback of the target parameter to be adjusted is complete. The target parameter to be adjusted is any one of the parameters to be adjusted.

[0051] Optionally, in this embodiment, the communication bus can be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. This communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The symbol is represented by a single thick line, but this does not indicate that there is only one bus or one type of bus. The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0052] The memory may include RAM, or non-volatile memory, such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0053] As an example, the memory 406 described above may include, but is not limited to, the determining module 302, generating module 304, adjusting module 306, and first rollback module 308 in the parameter rollback device for the cloud-native database described above. Furthermore, it may include, but is not limited to, other module units in the parameter rollback device for the cloud-native database described above, which will not be elaborated upon in this example.

[0054] The processor mentioned above can be a general-purpose processor, including but not limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processor), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0055] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments, and will not be repeated here.

[0056] Those skilled in the art will understand that Figure 4 The structure shown is for illustrative purposes only. The device that implements the parameter rollback method for the cloud-native database described above can be a terminal device, such as a smartphone (e.g., an Android phone, an iOS phone), a tablet computer, a PDA, a mobile internet device (MID), a PAD, or other terminal devices. Figure 4 This does not limit the structure of the aforementioned electronic devices. For example, the electronic device may also include components that are more... Figure 4 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 4 The different configurations shown.

[0057] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, ROM, RAM, disk or optical disk, etc.

[0058] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, which, when executed by a processor, performs the steps in the parameter rollback method for the cloud-native database described above.

[0059] Optionally, in this embodiment, those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0060] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0061] If the integrated units in the above embodiments are implemented as software functional units and sold or used as independent products, they can be stored in the aforementioned computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application.

[0062] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0063] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between units or modules, and may be electrical or other forms.

[0064] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0065] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0066] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A parameter rollback method for cloud-native databases, characterized in that, include: The received user-submitted parameter adjustment task is encapsulated into a custom resource object, and the old parameter value, target parameter value, database component to which it belongs, and parameter effective layer identifier of all parameters to be adjusted in the custom resource object are determined. For each parameter to be adjusted, a parameter rollback snapshot is generated and written to the status field of the custom resource object. The parameter rollback snapshot includes the parameter identifier, the old parameter value, the target parameter value, and the parameter effective layer identifier. For each parameter to be adjusted, based on its parameter type and the database component to which it belongs, its target parameter value is distributed layer by layer to at least one of the corresponding configuration resource layer, container configuration file layer, and database memory layer to perform parameter adjustment operations. If the adjustment of the target parameter to be adjusted fails, a layered rollback operation is performed according to the parameter effective layer identifier recorded in the parameter rollback snapshot of the target parameter to be adjusted, so as to restore the target parameter to be adjusted to the corresponding old parameter value. After the layered rollback operation is completed, the status field of the custom resource object is updated to indicate that the rollback of the target parameter to be adjusted is complete. The target parameter to be adjusted is any one of the parameters to be adjusted.

2. The method according to claim 1, characterized in that, Based on the parameter effective layer identifier recorded in the parameter rollback snapshot of the target parameter to be adjusted, a layered rollback operation is performed to restore the target parameter to its corresponding old parameter value, including: If the parameter effective layer of the target parameter to be adjusted is identified as the configuration resource layer, the Kubernetes API interface is called to write the key-value pair data of the target parameter to be adjusted in the configuration resource layer back to the old parameter value recorded in the parameter rollback snapshot of the target parameter to be adjusted, from the target parameter value of the target parameter to be adjusted.

3. The method according to claim 1, characterized in that, Based on the parameter effective layer identifier recorded in the parameter rollback snapshot of the target parameter to be adjusted, a layered rollback operation is performed to restore the target parameter to its corresponding old parameter value, including: If the parameter effective layer of the target parameter to be adjusted is identified as the container configuration file layer, a parameter rollback instruction is sent to the Pod corresponding to the database component to which the target parameter to be adjusted belongs. This is done inside the container to modify the line content of the target parameter to be adjusted in the configuration file from the target parameter value of the target parameter to the old parameter value recorded in the parameter rollback snapshot of the target parameter to be adjusted.

4. The method according to claim 1, characterized in that, Based on the parameter effective layer identifier recorded in the parameter rollback snapshot of the target parameter to be adjusted, a layered rollback operation is performed to restore the target parameter to its corresponding old parameter value, including: If the parameter effective layer of the target parameter to be adjusted is identified as the database memory layer, connect to the target database process to restore the running value in memory of the target parameter to be adjusted from the target parameter value of the target parameter to the old parameter value recorded in the parameter rollback snapshot of the target parameter to be adjusted.

5. The method according to claim 1, characterized in that, After completing the layered rollback operation, updating the status field of the custom resource object to indicate that the rollback of the target parameter to be adjusted is complete includes: After completing the layered rollback operation, write the status record of the target parameter to be adjusted rolled back to the status field of the custom resource object, and record the parameter identifier, rollback completion timestamp, and reason for triggering the rollback operation in the status record.

6. The method according to claim 1, characterized in that, After performing parameter adjustment operations on each parameter to be adjusted by progressively distributing its target parameter value to at least one of the corresponding configuration resource layer, container configuration file layer, and database memory layer, based on its parameter type and the database component to which it belongs, the method further includes: If the target parameter to be adjusted is successfully adjusted, delete the parameter rollback snapshot of the target parameter to be adjusted from the status field of the custom resource object; In the custom resource object, mark the lifecycle status of the parameter adjustment task for the target parameter to be adjusted as normally completed.

7. The method according to any one of claims 1 to 6, characterized in that, The method further includes: When a rollback instruction for a specific parameter to be adjusted, added by an operations and maintenance personnel, is detected in the comment section of the custom resource object, a layered rollback operation is performed according to the parameter effective layer identifier recorded in the parameter rollback snapshot of the specific parameter to be adjusted, so as to restore the specific parameter to be adjusted to the corresponding old parameter value. The specific parameter to be adjusted is any one of all parameters to be adjusted.

8. A parameter rollback device for a cloud-native database, characterized in that, include: The determination module is used to encapsulate the received user-submitted parameter adjustment task into a custom resource object, and determine the old parameter value, target parameter value, database component to which it belongs, and parameter effective layer identifier of all parameters to be adjusted in the custom resource object; The generation module is used to generate a parameter rollback snapshot for each parameter to be adjusted and write it into the status field of the custom resource object. The parameter rollback snapshot includes a parameter identifier, an old parameter value, a target parameter value, and a parameter effective layer identifier. The adjustment module is used to, for each parameter to be adjusted, according to its parameter type and the database component to which it belongs, send its target parameter value layer by layer to at least one of the corresponding configuration resource layer, container configuration file layer and database memory layer, so as to perform parameter adjustment operation on it; The first rollback module is used to perform a layered rollback operation based on the parameter effective layer identifier recorded in the parameter rollback snapshot of the target parameter to be adjusted when the adjustment of the target parameter to be adjusted fails. This operation restores the target parameter to be adjusted to the corresponding old parameter value. After the layered rollback operation is completed, the status field of the custom resource object is updated to indicate that the rollback of the target parameter to be adjusted is complete. The target parameter to be adjusted is any one of all parameters to be adjusted.

9. A computer-readable storage medium storing a computer program, characterized in that, The computer program is executed by the processor to perform the method described in any one of claims 1 to 7.

10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 7 through the computer program.