CN110941475A - Object deleting method and device in container cluster system and electronic equipment - Google Patents
Object deleting method and device in container cluster system and electronic equipment Download PDFInfo
- Publication number
- CN110941475A CN110941475A CN201911113960.8A CN201911113960A CN110941475A CN 110941475 A CN110941475 A CN 110941475A CN 201911113960 A CN201911113960 A CN 201911113960A CN 110941475 A CN110941475 A CN 110941475A
- Authority
- CN
- China
- Prior art keywords
- sequence
- objects
- deleting
- creation
- successfully created
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 78
- 230000008569 process Effects 0.000 claims abstract description 38
- 238000012217 deletion Methods 0.000 claims description 27
- 230000037430 deletion Effects 0.000 claims description 27
- 238000004891 communication Methods 0.000 claims description 18
- 238000004590 computer program Methods 0.000 claims description 10
- 238000012163 sequencing technique Methods 0.000 claims description 4
- 230000006870 function Effects 0.000 description 6
- 238000010586 diagram Methods 0.000 description 4
- 230000009471 action Effects 0.000 description 3
- 230000002085 persistent effect Effects 0.000 description 2
- 239000002699 waste material Substances 0.000 description 2
- 238000013500 data storage Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 239000000835 fiber Substances 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000007246 mechanism Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000012545 processing Methods 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/455—Emulation; Interpretation; Software simulation, e.g. virtualisation or emulation of application or operating system execution engines
- G06F9/45533—Hypervisors; Virtual machine monitors
- G06F9/45558—Hypervisor-specific management and integration aspects
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The embodiment of the invention provides a method and a device for deleting an object in a container cluster system and electronic equipment. Wherein the method comprises the following steps: when the object creation fails in the process of creating the objects in batch, acquiring the creation sequence of all objects which are successfully created; and deleting all objects which are successfully created in the forward order or the reverse order according to the creation order. When the objects are created in batch, the sequence of creating the objects is often determined according to the dependency relationship among the objects, and the objects which are successfully created are deleted according to the creating sequence without polling, so that the efficiency of deleting the objects can be improved.
Description
Technical Field
The present invention relates to the field of virtualization technologies, and in particular, to a method and an apparatus for deleting an object in a container cluster system, and an electronic device.
Background
In some container clustering systems, such as the K8S (kubemeters) system, multiple objects may need to be created in batches according to actual needs. When one of the objects fails to be created, the object that has been successfully created needs to be deleted to avoid the object that has been successfully created from continuously occupying resources, which is called a rollback mechanism. However, there may be a certain dependency relationship between different objects in the multiple objects, for example, there is a one-to-one correspondence relationship between PV (Persistent Volume) objects and PVC (Persistent Volume class) objects. As another example, a Deployment object may be used to create a pod object. And if the object on which the object depends is not deleted, the object cannot be deleted. For example, if object a is dependent on object b, object a cannot be deleted without object b being deleted.
In the related art, each object that has been successfully created may be polled to determine whether the object can be deleted, and when the object can be deleted, the object is deleted. And the polling is repeated until all objects that have been successfully created are deleted.
However, when the number of objects that have been successfully created is large, polling may take a long time, resulting in inefficient object deletion.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a device and electronic equipment for deleting an object in a container cluster system, so that the efficiency of deleting an object which is successfully created is improved when the object is failed to be created in the process of creating the object in batches. The specific technical scheme is as follows:
in a first aspect of the present invention, a method for deleting an object in a container cluster system is provided, where the method includes:
when the object creation fails in the process of creating the objects in batch, acquiring the creation sequence of all objects which are successfully created;
and deleting all objects which are successfully created in the forward order or the reverse order according to the creation order.
With reference to the first aspect, in a first possible implementation manner, the obtaining a creation order of all objects that have been successfully created includes:
acquiring an object identification sequence, wherein the object identification of each object successfully created is sequentially stored in the object identification sequence according to the creation sequence;
deleting all objects which are successfully created according to the creation sequence, namely deleting all objects which are successfully created in a forward sequence or a reverse sequence, wherein the deletion comprises the following steps:
and deleting the object represented by each object identifier in the object identifier sequence in a positive sequence or a negative sequence.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner, the object identification sequence is obtained in advance through the following manner:
and in the process of creating the objects in batches, sequentially storing the object identifier of each object successfully created to obtain an object identifier sequence.
With reference to the second possible implementation manner of the first aspect, in a third possible implementation manner, in the process of creating objects in batch, sequentially storing the object identifier of each object that is created successfully to obtain an object identifier sequence, where the step includes:
in the process of creating the objects in batch, when the objects are created successfully, after all the stored object identifiers in the object identifier sequence, the object identifiers of the objects are stored.
With reference to the first aspect, in a fourth possible implementation manner, the method further includes:
acquiring a sorting parameter, wherein the sorting parameter is used for representing the sequence or the reverse sequence;
deleting all objects which are successfully created according to the creation sequence, namely deleting all objects which are successfully created in a forward sequence or a reverse sequence, wherein the deletion comprises the following steps:
if the sorting parameter represents the sequence, deleting all objects which are successfully created in the forward sequence according to the creation sequence;
and if the sorting parameter represents the reverse order, deleting all objects which are successfully created in the reverse order according to the creation order.
In a second aspect of the present invention, there is provided an object deleting apparatus in a container cluster system, the apparatus comprising:
the sequencing module is used for acquiring the creation sequence of all objects which are successfully created when the object creation fails in the process of creating the objects in batches;
and the deleting module deletes all objects which are successfully created in a forward or reverse order according to the creating order.
With reference to the second aspect, in a first possible implementation manner, the sorting module is specifically configured to obtain an object identifier sequence, where the object identifier sequence sequentially stores, according to a creation order, object identifiers of each object that is successfully created;
deleting all objects which are successfully created according to the creation sequence, namely deleting all objects which are successfully created in a forward sequence or a reverse sequence, wherein the deletion comprises the following steps:
and deleting the object represented by each object identifier in the object identifier sequence in a positive sequence or a negative sequence.
With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner, the apparatus further includes a sequence recording module, configured to store the object identifier of each object that is successfully created in the batch object creating process, so as to obtain an object identifier sequence.
With reference to the second possible implementation manner of the second aspect, in a third possible implementation manner, the sequence recording module is specifically configured to, in a process of creating objects in batch, store object identifiers of the objects after all stored object identifiers in the object identifier sequence are stored whenever an object is successfully created.
With reference to the second aspect, in a fourth possible implementation manner, the deleting module is further configured to obtain a sorting parameter, where the sorting parameter is used to indicate a sequence or a reverse sequence;
the deleting module is specifically configured to delete all objects that have been successfully created in the forward order according to the creating order if the sorting parameter indicates an order;
and if the sorting parameter represents the reverse order, deleting all objects which are successfully created in the reverse order according to the creation order.
In a third aspect of the present invention, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
a memory for storing a computer program;
a processor adapted to perform the method steps of any of the above first aspects when executing a program stored in the memory.
In a fourth aspect of the present invention, a computer-readable storage medium is provided, having stored therein a computer program which, when executed by a processor, performs the method steps of any of the above-mentioned first aspects.
According to the method, the device and the electronic equipment for deleting the objects in the container cluster system, provided by the embodiment of the invention, the characteristic that when the objects are created in batches, the order of creating the objects is often determined according to the dependency relationship among the objects is utilized, and the objects which are successfully created are deleted according to the creating order without polling, so that the efficiency of deleting the objects can be improved. Of course, not all of the advantages described above need to be achieved at the same time in the practice of any one product or method of the invention.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of an object deleting method in a container cluster system according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of an object deletion method when object creation fails in a process of creating objects in batch in a container cluster system according to an embodiment of the present invention;
fig. 3 is another schematic flow chart of an object deletion method when object creation fails in a process of creating objects in batch in a container cluster system according to an embodiment of the present invention;
fig. 4a is a schematic structural diagram of an object deleting apparatus in a container cluster system according to an embodiment of the present invention;
fig. 4b is a schematic structural diagram of an object deleting apparatus in a container cluster system according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, fig. 1 is a schematic flowchart illustrating an object deleting method in a container cluster system according to an embodiment of the present invention, where the method may include:
s101, when object creation fails in the process of creating objects in batch, acquiring the creation sequence of all objects which are successfully created.
The representation form of the creation order may be different according to different application scenarios, and may be represented in the form of an object identification sequence, for example. For example, assuming that objects that have been successfully created are object a, object b, and object c, where object a has an object id of a, object b has an object id of b, object c has an object id of c, and object a is created before object b and object b is created before object c, the obtained creation order may be represented by an object id sequence in the form of { a, b, c }.
The object id is used to uniquely identify the object, that is, the object ids of different objects are different, and the same object id represents the same object. In other possible embodiments, the object identification may also be used to represent the object type of the object.
And S102, deleting all objects which are successfully created in the forward order or the reverse order according to the creation order.
The positive order deletion means that all objects which are successfully created are deleted from front to back according to the creation order. For example, assuming that the creation order is object a → object b → object c, object a may be deleted first, object b may be deleted, and object c may be deleted.
The reverse deletion refers to deleting all objects that have been successfully created from the back to the front in the creation order, for example, if the creation order is object a → object b → object c, then object b, and then object a may be deleted.
Whether the forward deletion or the reverse deletion is adopted can be preset, can be determined according to sequencing parameters input by a user, and can also be firstly adopted for forward deletion (or reverse deletion), and if the forward deletion (or reverse deletion) can not delete the object, the reverse deletion (or forward deletion) is adopted.
It can be understood that in the process of creating objects in batch, the order of creating objects is often determined according to the dependency relationship between the objects, for example, before creating a PVC object, a corresponding PV object needs to be created, the PV object depends on the PVC object, and therefore before deleting the PV object, the PVC object needs to be deleted, that is, the correct deletion order is the reverse order of the creation order. For another example, before a pod object is created, a corresponding deployment object needs to be created, and the deployment object depends on the pod object, so that the pod object needs to be deleted before the deployment object is deleted, that is, the correct deletion order is the positive order of the creation order. Thus, objects may be deleted in the order of creation, in forward order, or in reverse order.
By adopting the embodiment, the object creating sequence is determined according to the dependency relationship among the objects when the objects are created in batch in the container cluster system, and the objects which are successfully created are deleted according to the creating sequence without polling, so that the object deleting efficiency can be improved.
Referring to fig. 2, fig. 2 is a flowchart illustrating an object deleting method when object creation fails in a batch object creating process in a container cluster system according to an embodiment of the present invention, where the method may include:
s201, in the batch creation process, the object identifier of each object successfully created is sequentially stored to obtain an object identifier sequence.
In the process of creating the object in batch, whenever the object is created successfully, the object identifier of the object is saved after all the saved object identifiers in the object identifier sequence.
For example, assuming that object a, object b, and object c are created in sequence, the object identification sequence is initially an empty set. If the object a is successfully created, the object identifier a of the object a is saved in the object identifier sequence, and the object identifier sequence is { a }. If object b is also successfully created, object id b of object b is saved after a in the object id sequence, where the object id sequence is { a, b }. If object c is also successfully created, object id c of object c is saved after a, b in the object id sequence, at which point the object id sequence is { a, b, c }.
S202, when the object is failed to be created in the process of creating the objects in batch, an object identification sequence is obtained.
S203, deleting the object represented by each object identification in the object identification sequence in the forward sequence or the reverse sequence.
For example, assuming that the acquired object identification sequence is { a, b, c }, the positive order deletion refers to sequentially deleting the object a represented by a, deleting the object b represented by b, and deleting the object c represented by c. The reverse deletion means that the object c indicated by c, the object b indicated by b, and the object a indicated by a are deleted in sequence.
The deleting manner of different objects may be different, and in a possible embodiment, for each object identifier, the object represented by the object identifier may be deleted by calling a deleting function corresponding to the object identifier.
By adopting the embodiment, the creation sequence can be accurately and effectively represented by using the object identification sequence.
Referring to fig. 3, fig. 3 is a schematic flow chart of an object deletion method when object creation fails in a process of creating objects in batches in a container cluster system according to an embodiment of the present invention, which may include:
s301, arranging a plurality of objects to be created according to the dependency relationship, and storing the identifier of each object to be created in a preset sequence according to the arrangement sequence to obtain an object sequence to be created.
The objects to be created may be sorted according to an operation instruction input by a user. When sorting, the following should be satisfied: for each object, the object on which the object depends is located before the object, or, for each object, the object on which the object depends is located after the object. Illustratively, it is assumed that the object to be created includes an object a, an object b, and an object c, and that the object a depends on the object b and the object b depends on the object c. The objects to be created may be arranged in the order of { object a, object b, object c } or may be arranged in the order of { object c, object b, object a }.
The preset sequence may be an array or a list. The object identification of an object may be json data of the object and the json data includes at least an object type and a tag of the object.
S302, obtaining the sorting parameters.
The sorting parameter is used for indicating that when the object creation fails in the process of creating the objects in batches, the objects which are created successfully are deleted in the forward or reverse order. Since an object on which an object depends needs to be deleted before deleting the object, if a plurality of objects to be created are arranged in S301, the following are satisfied: for each object, the object on which the object depends is located before the object, then the ordering parameter may indicate positive order. If a plurality of objects to be created are arranged in S301, the following are satisfied: for each object, the object on which the object depends is located after the object, then the ordering parameter may indicate the reverse order.
S303, according to the sequence from first to last, sequentially aiming at each object in the object sequence to be created, calling a creating function corresponding to the object identifier, and creating the object represented by the object identifier.
S304, when the object is successfully created, after all the stored object identifiers in the object identifier sequence, storing the object identifier of the object.
See the relevant description in S201, and will not be described herein.
S305, when the object is failed to be created, acquiring an object identifier sequence, and calling a deleting function corresponding to the object identifier for each object identifier in the object identifier sequence in sequence according to the sequence represented by the sequencing parameter, so as to delete the object represented by the object identifier.
By adopting the embodiment, the objects to be created can be sorted in advance, so that the objects to be created are related to the dependency relationship, and the objects which are successfully created can be deleted correctly through the sorting parameters.
In one possible embodiment, the object that has been successfully created may be deleted after a failure to attempt to create the object. For example, assuming that the object a is an object to be created, a creating function corresponding to the object a may be called to create the object a, and if the object a is not successfully created after the creating function is called, the object that has been successfully created is deleted. However, in some application scenarios, the object creation failure may be caused by some temporary disturbances, such as network fluctuation and random fluctuation of device performance. When the part of the temporary disturbance disappears with time, the object can be created normally, and therefore in this case, if the object that has been created successfully is deleted, a waste of resources may be caused.
In view of this, in one possible embodiment, it may be determined whether the number of times that an object has failed to be created reaches a preset number threshold when the object has failed to be created. And if the preset number threshold value is reached, deleting the object which is successfully created. If the preset number threshold has not been reached, the object is recreated.
By adopting the embodiment, the influence of the temporary disturbance on the object creation can be avoided through multiple attempts in the application scene in which the object cannot be normally created in a short time due to the temporary disturbance, and the resource waste is avoided.
Referring to fig. 4a, fig. 4a is a schematic structural diagram of an object deleting apparatus in a container cluster system according to an embodiment of the present invention, where the object deleting apparatus may include:
a sorting module 401, configured to, when object creation fails in a batch object creation process, obtain a creation order of all objects that have been successfully created;
and a deleting module 402, which deletes all objects that have been successfully created in the forward order or the backward order according to the creating order.
In a possible embodiment, the sorting module 401 is specifically configured to obtain an object identifier sequence, where in the object identifier sequence, according to a creation sequence, object identifiers of objects that are created successfully are sequentially stored;
deleting all objects which are successfully created according to the creation sequence, namely deleting all objects which are successfully created in a forward sequence or a reverse sequence, wherein the deletion comprises the following steps:
and deleting the object represented by each object identifier in the object identifier sequence in a positive sequence or a negative sequence.
In a possible embodiment, as shown in fig. 4b, the apparatus further includes a sequence recording module 403, configured to store the object identifier of each object that is successfully created in sequence during the process of creating the objects in batch, so as to obtain an object identifier sequence.
In a possible embodiment, the sequence recording module 403 is specifically configured to, in the process of creating objects in batch, store the object identifiers of the objects after all the stored object identifiers in the object identifier sequence every time when the object creation is successful.
In a possible embodiment, the deleting module 402 is specifically configured to, when object creation fails in a batch object creating process, determine whether the number of times that the object has failed to create reaches a preset number threshold;
and if the times reach the preset times threshold value, acquiring the creation sequence of all objects which are successfully created.
In a possible embodiment, the deleting module 402 is further configured to recreate the object if the number of times does not reach the preset number of times threshold.
In a possible embodiment, the deleting module 402 is further configured to obtain a sorting parameter, where the sorting parameter is used to indicate an order or a reverse order;
the deleting module is specifically configured to delete all objects that have been successfully created in the forward order according to the creating order if the sorting parameter indicates an order;
and if the sorting parameter represents the reverse order, deleting all objects which are successfully created in the reverse order according to the creation order.
An embodiment of the present invention further provides an electronic device, as shown in fig. 5, which includes a processor 501, a communication interface 502, a memory 503 and a communication bus 504, where the processor 501, the communication interface 502 and the memory 503 complete mutual communication through the communication bus 504,
a memory 503 for storing a computer program;
the processor 501, when executing the program stored in the memory 503, implements the following steps:
when the object creation fails in the process of creating the objects in batch, acquiring the creation sequence of all objects which are successfully created;
and deleting all objects which are successfully created in the forward order or the reverse order according to the creation order.
In a possible embodiment, the obtaining the creation order of all objects that have been successfully created includes:
acquiring an object identification sequence, wherein the object identification of each object successfully created is sequentially stored in the object identification sequence according to the creation sequence;
deleting all objects which are successfully created according to the creation sequence, namely deleting all objects which are successfully created in a forward sequence or a reverse sequence, wherein the deletion comprises the following steps:
and deleting the object represented by each object identifier in the object identifier sequence in a positive sequence or a negative sequence.
In a possible embodiment, the object identification sequence is obtained in advance by:
and in the process of creating the objects in batches, sequentially storing the object identifier of each object successfully created to obtain an object identifier sequence.
In a possible embodiment, in the process of creating objects in batch, sequentially storing the object identifier of each object that is created successfully to obtain an object identifier sequence, the method includes:
in the process of creating the objects in batch, when the objects are created successfully, after all the stored object identifiers in the object identifier sequence, the object identifiers of the objects are stored.
In a possible embodiment, the obtaining a creation order of all objects that have been successfully created when the object creation fails in the batch creation of the objects includes:
when the object is failed to be created in the process of creating the objects in batch, determining whether the number of times that the object is failed to be created reaches a preset number threshold value;
and if the times reach the preset times threshold value, acquiring the creation sequence of all objects which are successfully created.
In a possible embodiment, the method further comprises:
and if the times do not reach the preset times threshold value, recreating the object.
In a possible embodiment, the method further comprises:
acquiring a sorting parameter, wherein the sorting parameter is used for expressing a positive sequence or a negative sequence;
deleting all objects which are successfully created according to the creation sequence, namely deleting all objects which are successfully created in a forward sequence or a reverse sequence, wherein the deletion comprises the following steps:
if the sorting parameter represents the sequence, deleting all objects which are successfully created in the forward sequence according to the creation sequence;
and if the sorting parameter represents the reverse order, deleting all objects which are successfully created in the reverse order according to the creation order.
The communication bus mentioned in the electronic device may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In another embodiment of the present invention, a computer-readable storage medium is further provided, which stores instructions that, when executed on a computer, cause the computer to execute the object deleting method in any container cluster system in the above embodiments.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the method for deleting objects in any of the container cluster systems in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the embodiments of the apparatus, the electronic device, the computer-readable storage medium, and the computer program product, since they are substantially similar to the method embodiments, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiments.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.
Claims (12)
1. A method for deleting objects in a container cluster system, the method comprising:
when the object creation fails in the process of creating the objects in batch, acquiring the creation sequence of all objects which are successfully created;
and deleting all objects which are successfully created in the forward order or the reverse order according to the creation order.
2. The method of claim 1, wherein obtaining the creation order of all objects that have been successfully created comprises:
acquiring an object identification sequence, wherein the object identification of each object successfully created is sequentially stored in the object identification sequence according to the creation sequence;
deleting all objects which are successfully created according to the creation sequence, namely deleting all objects which are successfully created in a forward sequence or a reverse sequence, wherein the deletion comprises the following steps:
and deleting the object represented by each object identifier in the object identifier sequence in a positive sequence or a negative sequence.
3. The method according to claim 2, wherein the object identification sequence is obtained in advance by:
and in the process of creating the objects in batches, sequentially storing the object identifier of each object successfully created to obtain an object identifier sequence.
4. The method according to claim 3, wherein in the process of creating objects in batch, sequentially storing the object identifier of each object that is created successfully to obtain an object identifier sequence, and the method comprises:
in the process of creating the objects in batch, when the objects are created successfully, after all the stored object identifiers in the object identifier sequence, the object identifiers of the objects are stored.
5. The method of claim 1, further comprising:
acquiring a sorting parameter, wherein the sorting parameter is used for expressing a positive sequence or a negative sequence;
deleting all objects which are successfully created according to the creation sequence, namely deleting all objects which are successfully created in a forward sequence or a reverse sequence, wherein the deletion comprises the following steps:
if the sorting parameter represents the sequence, deleting all objects which are successfully created in the forward sequence according to the creation sequence;
and if the sorting parameter represents the reverse order, deleting all objects which are successfully created in the reverse order according to the creation order.
6. An apparatus for deleting an object in a container cluster system, the apparatus comprising:
the sequencing module is used for acquiring the creation sequence of all objects which are successfully created when the object creation fails in the process of creating the objects in batches;
and the deleting module deletes all objects which are successfully created in a forward or reverse order according to the creating order.
7. The apparatus of claim 6, wherein the sorting module is specifically configured to obtain an object identifier sequence, where in the object identifier sequence, according to the creation order, object identifiers of objects that are created successfully are sequentially stored in each of the object identifiers;
deleting all objects which are successfully created according to the creation sequence, namely deleting all objects which are successfully created in a forward sequence or a reverse sequence, wherein the deletion comprises the following steps:
and deleting the object represented by each object identifier in the object identifier sequence in a positive sequence or a negative sequence.
8. The apparatus according to claim 7, further comprising a sequence recording module, configured to store the object identifier of each successfully created object in sequence during batch creation of the objects, so as to obtain an object identifier sequence.
9. The apparatus according to claim 8, wherein the sequence recording module is specifically configured to, in the process of creating objects in batch, store the object id of an object after all stored object ids in the object id sequence whenever the object creation is successful.
10. The apparatus according to claim 6, wherein the deleting module is further configured to obtain a sorting parameter, where the sorting parameter is used to indicate an order or a reverse order;
the deleting module is specifically configured to delete all objects that have been successfully created in the forward order according to the creating order if the sorting parameter indicates an order;
and if the sorting parameter represents the reverse order, deleting all objects which are successfully created in the reverse order according to the creation order.
11. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any one of claims 1 to 5 when executing a program stored in the memory.
12. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of the claims 1-5.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911113960.8A CN110941475A (en) | 2019-11-14 | 2019-11-14 | Object deleting method and device in container cluster system and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911113960.8A CN110941475A (en) | 2019-11-14 | 2019-11-14 | Object deleting method and device in container cluster system and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN110941475A true CN110941475A (en) | 2020-03-31 |
Family
ID=69906748
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911113960.8A Pending CN110941475A (en) | 2019-11-14 | 2019-11-14 | Object deleting method and device in container cluster system and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110941475A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020099684A1 (en) * | 1995-05-09 | 2002-07-25 | Jean-Louis Ardoin | Object relationship management system |
CN101236510A (en) * | 2008-02-22 | 2008-08-06 | 深圳市金蝶中间件有限公司 | EJB cluster failure recovery processing method and system |
CN104468641A (en) * | 2013-09-12 | 2015-03-25 | 腾讯科技(深圳)有限公司 | Service data migration method and device and cloud storage system |
CN105117410A (en) * | 2015-07-28 | 2015-12-02 | 阿里巴巴集团控股有限公司 | Application object creation method and apparatus |
US9417917B1 (en) * | 2012-12-14 | 2016-08-16 | Amazon Technologies, Inc. | Equitable resource allocation for storage object deletion |
CN108009002A (en) * | 2017-11-29 | 2018-05-08 | 顺丰科技有限公司 | A kind of live migration of virtual machine method, apparatus, equipment and storage medium |
-
2019
- 2019-11-14 CN CN201911113960.8A patent/CN110941475A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20020099684A1 (en) * | 1995-05-09 | 2002-07-25 | Jean-Louis Ardoin | Object relationship management system |
CN101236510A (en) * | 2008-02-22 | 2008-08-06 | 深圳市金蝶中间件有限公司 | EJB cluster failure recovery processing method and system |
US9417917B1 (en) * | 2012-12-14 | 2016-08-16 | Amazon Technologies, Inc. | Equitable resource allocation for storage object deletion |
CN104468641A (en) * | 2013-09-12 | 2015-03-25 | 腾讯科技(深圳)有限公司 | Service data migration method and device and cloud storage system |
CN105117410A (en) * | 2015-07-28 | 2015-12-02 | 阿里巴巴集团控股有限公司 | Application object creation method and apparatus |
CN108009002A (en) * | 2017-11-29 | 2018-05-08 | 顺丰科技有限公司 | A kind of live migration of virtual machine method, apparatus, equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108153670B (en) | Interface testing method and device and electronic equipment | |
CN111381987A (en) | Message processing method and device, electronic equipment and medium | |
CN110442502B (en) | Point burying method, device, equipment and storage medium | |
CN110069217B (en) | Data storage method and device | |
CN107577527B (en) | Task generation and scheduling method and device | |
CN111782728B (en) | Data synchronization method, device, electronic equipment and medium | |
CN110769057A (en) | Automatic upgrading method, device and system based on cascade system | |
US10205813B2 (en) | Method and system for detecting abnormal contact information and server | |
CN108108126B (en) | Data processing method, device and equipment | |
CN114564446A (en) | File storage method, device, system and storage medium | |
CN114328029B (en) | Backup method and device of application resources, electronic equipment and storage medium | |
WO2024022424A1 (en) | System and methods for metadata services | |
CN109976828B (en) | Method and device for configuring file | |
CN110674153B (en) | Data consistency detection method and device and electronic equipment | |
CN110941475A (en) | Object deleting method and device in container cluster system and electronic equipment | |
CN110768834A (en) | Method, system, device and medium for notifying configuration upgrading result of virtual machine | |
CN111399754B (en) | Method and device for releasing storage space and distributed system | |
CN117453665B (en) | Data processing method, device, equipment and storage medium | |
CN112583761A (en) | Management method and device of security entity, computer equipment and storage medium | |
CN111179097B (en) | Method, device, electronic equipment and storage medium for modifying warranty | |
US11163462B1 (en) | Automated resource selection for software-defined storage deployment | |
CN110909171B (en) | Data scheduling method, device, terminal and storage medium | |
CN110858848B (en) | Correction method and device for task resources of cluster system | |
CN111666733B (en) | Method and device for processing cells in document | |
CN109241066B (en) | Request processing method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200331 |
|
RJ01 | Rejection of invention patent application after publication |