CN116166437A - Processing method, storage medium and equipment for database session process - Google Patents

Processing method, storage medium and equipment for database session process Download PDF

Info

Publication number
CN116166437A
CN116166437A CN202310187093.2A CN202310187093A CN116166437A CN 116166437 A CN116166437 A CN 116166437A CN 202310187093 A CN202310187093 A CN 202310187093A CN 116166437 A CN116166437 A CN 116166437A
Authority
CN
China
Prior art keywords
session
session process
database
information
shared memory
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
Application number
CN202310187093.2A
Other languages
Chinese (zh)
Inventor
刘建康
李翔
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingbase Information Technologies Co Ltd
Original Assignee
Beijing Kingbase Information Technologies Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Kingbase Information Technologies Co Ltd filed Critical Beijing Kingbase Information Technologies Co Ltd
Priority to CN202310187093.2A priority Critical patent/CN116166437A/en
Publication of CN116166437A publication Critical patent/CN116166437A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5022Mechanisms to release resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/466Transaction processing
    • G06F9/467Transactional memory
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements 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/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5011Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals
    • G06F9/5016Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resources being hardware resources other than CPUs, Servers and Terminals the resource being the memory
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention provides a processing method, a storage medium and equipment for a database session process. Wherein the method comprises the following steps: a database father process allocates exclusive shared memory; starting a session process and recording the session process into a process list; the session process records the information of accessing the shared resource into the exclusive shared memory; the father process of the database obtains the exit information of the session process, and judges whether the session process exits normally according to the exit information; and under the abnormal exit condition, releasing and recovering the shared resources according to the information in the exclusive shared memory. By the method, the failed session process is isolated from the normal session process, so that other normal session processes are not influenced; shared resources related to the failed session process can be normally released, and access of other session processes to the shared resources is not affected; after the session process fails, the database does not need to enter a crash recovery stage, and can still normally provide services.

Description

Processing method, storage medium and equipment for database session process
Technical Field
The present invention relates to database technologies, and in particular, to a method, a storage medium, and an apparatus for processing a database session process.
Background
In a multi-process database, inter-process communication needs to be completed by means of semaphores, shared memory, pipes, etc. Each session (session) of the user corresponds to a background process of the database (hereinafter referred to as "session process" refers to the background process) except for the background process of the function specific to the database itself. In the case of concurrency of multiple session processes, in order to control concurrency and resource contention among session processes, communication and control are performed among session processes and among other background processes in a semaphore, shared memory, lock or other manner.
In this scenario, once the session process fails (crashes, is accidentally killed, etc.) due to an unknown problem, the acquired lock cannot be released, the accessed shared memory cannot be cleaned, and other session processes may not run normally.
When the session process fails, the whole database is crashed and recovered, namely all other session processes are forced to exit, the database enters a crashed and recovered state, is reinitialized and then provides services to the outside.
Disclosure of Invention
It is an object of the present invention that other database session processes can still function properly in the event of a database session process failure.
A further object of the present invention is that the shared resources involved in the failed session process can be normally released, and the access of other session processes to the shared resources is not affected.
A further object of the present invention is that after a session process fails, the database does not need to enter a crash recovery stage, and the database can still provide services normally.
In particular, the present invention provides a method for processing a database session process, which includes:
a database father process allocates exclusive shared memory;
starting a session process and recording the session process into a process list;
the session process records the information of accessing the shared resource into the exclusive shared memory;
the father process of the database obtains the exit information of the session process, and judges whether the session process exits normally according to the exit information;
and under the abnormal exit condition, releasing and recovering the shared resources according to the information in the exclusive shared memory.
Optionally, after the step of recording the information of accessing the shared resource into the dedicated shared memory, the session process further includes:
if the session process is normally operated, cleaning the shared resources according to records in the exclusive shared memory, and sending normal exit information to the database parent process;
and if the session process runs and fails, sending failure exit information to the database parent process.
Optionally, the step of assigning the exclusive shared memory to the database parent process includes: the father process of the database allocates exclusive shared memory according to the session number of the session process;
the step of releasing and recovering the shared resource according to the information in the exclusive shared memory comprises the following steps: and the database parent process finds the exclusive shared memory according to the session number of the session process, and releases and recovers the shared resource according to the information in the exclusive shared memory.
Optionally, the step of obtaining the exit information of the session process by the database parent process and judging whether the session process exits normally according to the exit information includes:
the father process of the database obtains the return information of the session process and judges whether the return information is exit information;
if the return information is the exit information, it is determined whether the return information is the normal exit information.
Optionally, the step of determining whether the returned information is the normal exit information further includes:
if the exit information is normal exit information, cleaning database resources occupied by the session process;
deleting the session process in the process list;
and (3) clearing the exclusive shared memory of the session process and waiting for being allocated to a new session process.
Optionally, the step of releasing and recovering the shared resource according to the information in the dedicated shared memory includes:
cleaning database resources occupied by session processes;
deleting the session process in the process list;
and (3) clearing the shared memory corresponding to the session process, and waiting for being allocated to a new session process.
Optionally, the step of recording the information of accessing the shared resource by the session process into the dedicated shared memory includes:
the session process records the information of the shared resource into a dedicated shared memory;
session processes access shared resources.
Optionally, the shared resources include:
lock information and shared memory information used in the process of executing the session.
According to another aspect of the present invention, there is also provided a machine-readable storage medium having stored thereon a machine-executable program which when executed by a processor implements a method of processing a database session process of any of the above.
According to yet another aspect of the present invention, there is also provided a computer device including a memory, a processor, and a machine executable program stored on the memory and running on the processor, and a processing method for implementing any one of the above database session processes when the processor executes the machine executable program.
According to the processing method of the database session process, the database father process allocates the exclusive shared memory according to the session number of the session process; starting a session process and recording the session process into a process list; the session process records the information of accessing the shared resource into the exclusive shared memory. The database father process records the shared resource accessed by each session process by allocating a dedicated shared memory to each session process, so that when the session process is abnormal, the failed session process is isolated from the normal session process, other normal session processes are not influenced, other sessions can still be normally performed, and the transaction is not interrupted.
Further, according to the processing method of the database session process, when the session process is abnormally exited, the database parent process releases and recovers the shared resources according to the information in the exclusive shared memory corresponding to the session process. Therefore, the shared resources related to the failed session process can be normally released, the access of other session processes to the shared resources is not influenced, and after the session process fails, the database does not need to enter a crash recovery stage, and the database can still normally provide services.
The above, as well as additional objectives, advantages, and features of the present invention will become apparent to those skilled in the art from the following detailed description of a specific embodiment of the present invention when read in conjunction with the accompanying drawings.
Drawings
Some specific embodiments of the invention will be described in detail hereinafter by way of example and not by way of limitation with reference to the accompanying drawings. The same reference numbers will be used throughout the drawings to refer to the same or like parts or portions. It will be appreciated by those skilled in the art that the drawings are not necessarily drawn to scale. In the accompanying drawings:
FIG. 1 is a flow diagram of a database session process;
FIG. 2 is a schematic diagram of a database session process versus shared resources;
FIG. 3 is a flow diagram of a database parent process;
FIG. 4 is a flow diagram of a method of processing a database session process according to one embodiment of the invention;
FIG. 5 is a flow chart of a database session process initiated by a database parent process in a method of processing a database session process according to one embodiment of the present invention;
FIG. 6 is a schematic diagram of a relationship between a database session process and a shared resource in a method for processing a database session process according to an embodiment of the present invention;
FIG. 7 is a flow diagram of a database parent process in a method of processing a database session process according to one embodiment of the invention;
FIG. 8 is a schematic diagram of a machine-readable storage medium in a method of processing a database session process according to one embodiment of the invention; and
fig. 9 is a schematic diagram of a computer device in a method for processing a database session process according to an embodiment of the present invention.
Detailed Description
It should be understood by those skilled in the art that the embodiments described below are only some embodiments of the present invention, but not all embodiments of the present invention, and the some embodiments are intended to explain the technical principles of the present invention and are not intended to limit the scope of the present invention. All other embodiments, which can be obtained by a person skilled in the art without any inventive effort, based on the embodiments provided by the present invention, shall still fall within the scope of protection of the present invention.
In a multi-process database, inter-process communication needs to be completed by means of semaphores, shared memory, pipes, etc. Each session (session) of the user corresponds to a background process of the database (hereinafter referred to as "session process" refers to the background process) except for the background process of the function specific to the database itself. In the case of concurrency of multiple session processes, in order to control concurrency and resource contention among session processes, communication and control are performed among session processes and among other background processes in a semaphore, shared memory, lock or other manner.
In this scenario, once the session process fails (crashes, is accidentally killed, etc.) due to an unknown problem, the acquired lock cannot be released, the accessed shared memory cannot be cleaned, and other session processes may not run normally. In view of the above, a treatment method is shown in fig. 1 to 3;
wherein fig. 1 is a flow diagram of a database session process. The process generally includes the steps of:
step S101, a session process is started.
Step S102, preparing to access the shared resource.
Step S103, acquire lock.
Step S104, record the lock information to the chain table.
Step S105, modifying the shared resource.
Step S106, the shared memory information is recorded to a callback chain list.
Step S107, other operations are performed.
Step S108, the process is ready to end.
Step S109, cleaning according to the callback chain list.
Step S110, releasing the lock according to the chain table.
In step S111, the session process ends.
FIG. 2 is a schematic diagram of the database session process of FIG. 1 in relation to shared resources. The schematic diagram comprises:
in step S201, the chaining table 212 in the session process one 211 records the information of the lock used by the session process one 211 in the shared resource 220.
In step S202, the callback list 213 in the session process one 211 records the information of the shared memory modified by the session process one 211 in the shared resource 220.
In step S203, the chaining table 215 in the second session process 214 records the information of the lock used by the second session process 214 in the shared resource 220.
In step S204, the callback chain table 216 in the second session process 214 records the information of the shared memory modified by the second session process 214 in the shared resource 220.
In step S205, the chaining table 218 in Session Process three 217 records information of locks used by Session Process three 217 in shared resource 220.
In step S206, the callback chain 219 in the third session process 217 records the information of the shared memory modified by the third session process 217 in the shared resource 220.
FIG. 3 is a flow diagram of a database parent process. The process generally includes the steps of:
step S301, a database parent process is started.
Step S302, creating a shared resource and initializing.
Step S303, wait for session process return information.
Step S304, judging whether the return information is session process exit information, if not, continuing to execute step S303.
In step S305, if the determination in step S304 is yes, it is determined whether the return information is normal exit information.
In step S306, if yes in step S305, the number of connections and signals occupied by the session progress are cleared.
Step S307, deleting the session process from the process list
Step S308, if step S305 is negative, signals are sent to all processes in the process list, and the process is forced to exit
Step S309, the process list is cleared, the shared resource is deleted, and the step S302 is continued.
Through the process flows of fig. 1 to 3, after a single session process fails, all other sessions are forced to be interrupted and exit, and all ongoing transactions are interrupted.
To solve the above problem, fig. 4 is a flowchart of a processing method of a database session process according to an embodiment of the present invention. The process generally includes the steps of:
in step S401, the database parent process allocates dedicated shared memory. In this step, the database parent process allocates a dedicated shared memory according to the session number of the session process.
Step S402, a session process is started and recorded in a process list. The so-called process list is used to record all session process information running in the database.
In step S403, the session process records the information of accessing the shared resource into the dedicated shared memory. Wherein the shared resources include locks, shared memory, etc. The method comprises the following steps: before accessing the shared resource, the session process records the information of the shared resource in the exclusive shared memory, and then starts to access the shared resource. Realize "record before visit". By the method, the problem that the shared resource cannot be recovered because the accessed shared resource is not recorded when the session process fails can be prevented.
In step S404, the database parent process acquires the exit information of the session process.
Step S405, it is determined whether the session process is normally exited. The method comprises the following steps: the father process of the database obtains the return information of the session process and judges whether the return information is exit information; if the return information is the exit information, it is determined whether the return information is the normal exit information.
Step S406, if the determination in step S405 is negative, releasing and recovering the shared resource according to the information in the dedicated shared memory. The method comprises the following steps: and the database parent process finds the exclusive shared memory according to the session number of the session process, and releases and recovers the shared resource according to the information in the exclusive shared memory.
In the method, a database father process allocates a dedicated shared memory according to a session number of a session process, and the session process records information of accessing a shared resource into the dedicated shared memory in the process of executing the session process; when the session process is abnormally exited, the database parent process releases and recovers the shared resources according to the information in the exclusive shared memory corresponding to the session process. The database father process records the shared resource accessed by each session process by allocating a dedicated shared memory to each session process, so that when the session process is abnormal, the shared resource can be recovered and released according to the information in the shared memory, and the recovery of the abnormal session process is completed on the premise that the execution of other session processes is not influenced, and the performance of the database is improved.
Fig. 5 is a schematic flow chart of starting a database session process by a database parent process in a method for processing a database session process according to an embodiment of the present invention. The process generally includes the steps of:
in step S501, dedicated shared memory is allocated according to the session number.
Step S502, a session process is started.
In step S503, the session is recorded into the process list. Wherein a so-called process list is used to record all session process information running in the database.
In step S504, the session process is started.
Step S505, prepare to access the shared resource.
In step S506, the session process records the shared resource in the dedicated shared memory.
Step S507, access to the shared resource. The "record before access" of the shared resource is realized through step S506-step S507. By the method, the problem that the shared resource cannot be recovered because the accessed shared resource is not recorded when the session process fails can be prevented.
Step S508, other operations are performed.
Step S509, the process is ready to end.
Step S510, the corresponding data in the dedicated shared memory is cleared. The method comprises the step of clearing the information of accessing the shared resources recorded in the exclusive shared memory when the session process is completed normally.
In step S511, the session normal exit information is sent, and the session process ends.
Through the process, the database father process records the shared resource accessed by each session process by allocating the exclusive shared memory to each session process, so that when the session process is abnormal, the failed session process is isolated from the normal session process, other normal session processes are not influenced, other sessions can still be normally performed, and the transaction is not interrupted.
Fig. 6 is a schematic diagram of a relationship between a database session process and a shared resource in a method for processing a database session process according to an embodiment of the present invention. The schematic diagram comprises:
in step S601, the session process one 611 records the information of the shared resource 623 to be accessed in the execution process in the dedicated shared memory 612.
In step S602, the chaining table 613 in the dedicated shared memory 612 records the information of the lock used by the session process one 611 in the shared resource 623.
In step S603, the callback list 614 in the dedicated shared memory 612 records the information of the shared memory modified by the session process one 611 in the shared resource 623.
In step S604, the session process two 615 records the information of the shared resource 623 to be accessed in the execution process in the dedicated shared memory 616.
In step S605, the chaining table 617 in the dedicated shared memory 616 records the information of the lock used by the second session process 615 in the shared resource 623.
In step S606, the callback link table 618 in the dedicated shared memory 616 records the information of the shared memory modified by the session process two 615 in the shared resource 623.
In step S607, the session process three 619 records the information of the shared resource 623 to be accessed in the execution process in the dedicated shared memory 620.
In step S608, the chaining table 621 in the dedicated shared memory 620 records the information of the lock used by the session process three 619 in the shared resource 623.
In step S609, the callback list 622 in the dedicated shared memory 620 records the information of the shared memory modified by the session process three 619 in the shared resource 623.
According to the method, the session process records the accessed shared resource information in the corresponding linked list in the exclusive shared memory, so that the session process is isolated from each other, other session processes are not affected, the shared resource information accessed by the session process can be checked when the session process fails, and the shared resource is recovered on the premise that other session processes are not affected, and all processes are not required to be stopped.
Fig. 7 is a flow chart of a database parent process in a method for processing a database session process according to an embodiment of the present invention. The process comprises the following steps:
in step S701, the database parent process is started.
Step S702, creating a shared resource and initializing.
Step S703, waiting for session process return information.
Step S704, determining whether the return information is session progress exit information, if not, continuing to execute step S703.
Step S705, if yes in step S704, of determining whether the return information is normal exit information.
Step S706, if the determination in step S705 is negative, finds the exclusive shared memory of the session process. The method comprises the following steps: if the step S705 determines no, the exclusive shared memory of the session process is found according to the session number of the session process.
Step S707, releasing and recovering the shared resources according to the information recorded in the exclusive shared memory.
Step S708, when step S705 determines yes or step S707 completes, the number of connections and signals occupied by the session progress are cleared.
Step S709, deleting the session process from the process list
In step S710, the exclusive shared memory of the session process is cleared, and the session process waits for allocation to a new session process.
In the process, the database father process records the shared resources accessed by each session process by allocating a dedicated shared memory to the session process, when the session process is abnormal, the database father process receives the return information and judges that the session process is abnormal to exit, then the dedicated shared memory of the session process is found according to the session number of the session process, and the shared resources are released and recovered according to the information recorded in the dedicated shared memory, so that the recovery of the abnormal session process is completed on the premise that the execution of other session processes is not influenced, and the performance of the database is improved.
The present implementation also provides a machine-readable storage medium and a computer device. Fig. 8 is a schematic diagram of a machine-readable storage medium 801 according to one embodiment of the invention, and fig. 9 is a schematic diagram of a computer device 903 according to one embodiment of the invention.
The machine-readable storage medium 801 has stored thereon a machine-executable program 802, which when executed by a processor, implements the method of processing a database session process of any of the embodiments described above.
The computer device 903 may include a memory 901, a processor 902, and a machine executable program 802 stored on the memory 901 and running on the processor 902, and the processing method of the database session process of any of the embodiments described above is implemented when the processor 902 executes the machine executable program 802.
It should be noted that the logic and/or steps represented in the flow diagrams or otherwise described herein, e.g., allocating dedicated shared memory for the session process, may be embodied in any machine-readable storage medium for use by or in connection with an instruction execution system, apparatus, or device, e.g., a computer-based system, processor-containing system, or other system that can fetch the instructions from the instruction execution system, apparatus, or device and execute the instructions.
For the purposes of this description of the embodiment, a machine-readable storage medium 801 can be any means that can contain, store, communicate, propagate, or transport the program for use by or in connection with the instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of the machine-readable storage medium 801 include the following: an electrical connection (electronic device) having one or more wires, a portable computer diskette (magnetic device), a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disc read-only memory (CDROM). Additionally, the machine-readable storage medium 801 may even be paper or other suitable medium upon which the program is printed, as the program may be electronically captured, via, for instance, optical scanning of the paper or other medium, then compiled, interpreted, or otherwise processed in a suitable manner if necessary, and then stored in a computer memory.
It is to be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above-described embodiments, the various steps or methods may be implemented in software or firmware stored in a memory and executed by a suitable instruction execution system.
The computer device 903 may be, for example, a server, a desktop computer, a notebook computer, a tablet computer, or a smartphone. In some examples, the computer device 903 may be a cloud computing node. The computer device 903 may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer device 903 may be implemented in a distributed cloud computing environment where remote processing devices, linked through a communications network, perform tasks. In a distributed cloud computing environment, program modules may be located in both local and remote computing system storage media including memory storage devices.
The computer device 903 may comprise a processor 902 adapted to execute stored instructions, a memory 901 providing temporary storage for the operation of the instructions during operation. The processor 902 may be a single core processor, a multi-core processor, a computing cluster, or any number of other configurations. Memory 901 may include Random Access Memory (RAM), read only memory, flash memory, or any other suitable storage system.
The processor 902 may be connected via a system interconnect (e.g., PCI-Express, etc.) to an I/O interface (input/output interface) adapted to connect the computer device 903 to one or more I/O devices (input/output devices). The I/O devices may include, for example, a keyboard and a pointing device, which may include a touch pad or touch screen, among others. The I/O device may be a built-in component of the computer device 403 or may be a device externally connected to the computing device.
The processor 902 may also be linked by a system interconnect to a display interface adapted to connect the computer device 903 to a display device. The display device may include a display screen as a built-in component of the computer device 903. The display device may also include a computer monitor, television, projector, or the like, which is externally connected to the computer device 903. Further, a network interface controller (network interface controller, NIC) may be adapted to connect the computer device 903 to a network through a system interconnect. In some embodiments, the NIC may use any suitable interface or protocol (such as an internet small computer system interface, etc.) to transfer data. The network may be a cellular network, a radio network, a Wide Area Network (WAN), a Local Area Network (LAN), or the internet, among others. The remote device may be connected to the computing device through a network.
The flowcharts provided by this embodiment are not intended to indicate that the operations of the method are to be performed in any particular order, or that all of the operations of the method are included in all of each case. Furthermore, the method may include additional operations. Additional variations may be made to the above-described methods within the scope of the technical ideas provided by the methods of the present embodiments.
By now it should be appreciated by those skilled in the art that while a number of exemplary embodiments of the invention have been shown and described herein in detail, many other variations or modifications of the invention consistent with the principles of the invention may be directly ascertained or inferred from the present disclosure without departing from the spirit and scope of the invention. Accordingly, the scope of the present invention should be understood and deemed to cover all such other variations or modifications.

Claims (10)

1. A method of processing a database session process, comprising:
a database father process allocates exclusive shared memory;
starting the session process and recording the session process into a process list;
the session process records the information of accessing the shared resource into the exclusive shared memory;
the database father process obtains the exit information of the session process and judges whether the session process exits normally according to the exit information;
and under the abnormal exit condition, releasing and recovering the shared resources according to the information in the exclusive shared memory.
2. The method for processing a database session process according to claim 1, wherein,
the step of recording the information of accessing the shared resource into the exclusive shared memory by the session process further comprises the following steps:
if the session process is normally operated, cleaning the shared resource according to the record in the exclusive shared memory, and sending normal exit information to the database father process;
and if the session process runs and fails, sending failure exit information to the database parent process.
3. The method for processing a database session process according to claim 1, wherein,
the step of allocating the exclusive shared memory by the database father process comprises the following steps: the database father process allocates exclusive shared memory according to the session number of the session process;
the step of releasing and recovering the shared resource according to the information in the exclusive shared memory comprises the following steps: and the database father process finds the exclusive shared memory according to the session number of the session process, and releases and recovers the shared resource according to the information in the exclusive shared memory.
4. The method for processing a database session process according to claim 1, wherein,
the step of the database father process obtaining the exit information of the session process and judging whether the session process exits normally according to the exit information comprises the following steps:
the database father process obtains the return information of the session process and judges whether the return information is exit information or not;
and judging whether the returned information is normal exit information or not under the condition that the returned information is exit information.
5. The method for processing a database session process of claim 4 wherein,
the step of judging whether the returned information is the normal exit information further comprises the following steps:
if the exit information is the normal exit information, cleaning database resources occupied by the session process;
deleting the session process in the process list;
and clearing the exclusive shared memory of the session process and waiting for being allocated to a new session process.
6. The method for processing a database session process according to claim 1, wherein,
the step of releasing and recovering the shared resource according to the information in the exclusive shared memory includes:
cleaning database resources occupied by the session process;
deleting the session process in the process list;
and clearing the shared memory corresponding to the session process, and waiting for being allocated to a new session process.
7. The method for processing a database session process according to claim 1, wherein,
the step of recording the information of accessing the shared resource into the exclusive shared memory by the session process comprises the following steps:
the session process records the information of the shared resource into the exclusive shared memory;
the session process accesses the shared resource.
8. The method for processing a database session process according to claim 1, wherein,
the shared resource includes:
lock information and shared memory information used in the executing process of the session process.
9. A machine-readable storage medium having stored thereon a machine-executable program which when executed by a processor implements a method of processing a database session process according to any of claims 1 to 8.
10. A computer device comprising a memory, a processor and a machine executable program stored on the memory and running on the processor, and the processor implementing a method of processing a database session procedure according to any one of claims 1 to 8 when executing the machine executable program.
CN202310187093.2A 2023-02-22 2023-02-22 Processing method, storage medium and equipment for database session process Pending CN116166437A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310187093.2A CN116166437A (en) 2023-02-22 2023-02-22 Processing method, storage medium and equipment for database session process

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310187093.2A CN116166437A (en) 2023-02-22 2023-02-22 Processing method, storage medium and equipment for database session process

Publications (1)

Publication Number Publication Date
CN116166437A true CN116166437A (en) 2023-05-26

Family

ID=86416244

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310187093.2A Pending CN116166437A (en) 2023-02-22 2023-02-22 Processing method, storage medium and equipment for database session process

Country Status (1)

Country Link
CN (1) CN116166437A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117857614A (en) * 2023-12-14 2024-04-09 天翼云科技有限公司 SESSION processing system for network data flow in multi-core scene

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117857614A (en) * 2023-12-14 2024-04-09 天翼云科技有限公司 SESSION processing system for network data flow in multi-core scene

Similar Documents

Publication Publication Date Title
US5878205A (en) Method and system for processing complex recovery using polling signals in a shared medium
CN111045794B (en) Distributed transaction processing method, device, system, computer equipment and storage medium
US8495618B1 (en) Updating firmware in a high availability enabled computer system
US5664088A (en) Method for deadlock recovery using consistent global checkpoints
JP2019516171A (en) Service processing method, device and system
JP2005004754A (en) Device and method for maintaining resource integrity without unified transaction manager in software environment
US20080082761A1 (en) Generic locking service for business integration
US20120011100A1 (en) Snapshot acquisition processing technique
CN111258976A (en) Distributed lock implementation method, system, device and storage medium
CN108287769B (en) Information processing method and device
US7792977B1 (en) Method for fencing shared resources from cluster nodes
CN109684048B (en) Method and device for processing transaction in transaction submitting system
CN116166437A (en) Processing method, storage medium and equipment for database session process
CN111414263A (en) Information processing method, device, server and storage medium
JP2000194678A (en) Asynchronous i/o highly available in cluster computer system
US8468386B2 (en) Detecting and recovering from process failures
CN115629785A (en) Upgrading method, electronic device and storage medium
CN116166390A (en) Service processing method and device, electronic equipment and storage medium
JP7305898B2 (en) Operation response method, operation response device, electronic device and storage medium
KR20230124099A (en) Method and apparatus for ensuring continued device operational reliability in cloud-degraded mode
US11500857B2 (en) Asynchronous remote calls with undo data structures
CN115292092A (en) Data rollback method, device, equipment and storage medium thereof
CN109740027B (en) Data exchange method, device, server and storage medium
US8365008B2 (en) Providing unsolicited global disconnect requests to users of storage
JP3101353B2 (en) Process parent-child relationship handover unit

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
CB02 Change of applicant information
CB02 Change of applicant information

Country or region after: China

Address after: 100102 201, 2 / F, 101, No. 5 building, No. 7 Rongda Road, Chaoyang District, Beijing

Applicant after: China Electronics Technology Group Jincang (Beijing) Technology Co.,Ltd.

Address before: 100102 201, 2 / F, 101, No. 5 building, No. 7 Rongda Road, Chaoyang District, Beijing

Applicant before: BEIJING KINGBASE INFORMATION TECHNOLOGIES Inc.

Country or region before: China