CN107145499A - The method and apparatus filed for ahead daily record - Google Patents
The method and apparatus filed for ahead daily record Download PDFInfo
- Publication number
- CN107145499A CN107145499A CN201710117680.9A CN201710117680A CN107145499A CN 107145499 A CN107145499 A CN 107145499A CN 201710117680 A CN201710117680 A CN 201710117680A CN 107145499 A CN107145499 A CN 107145499A
- Authority
- CN
- China
- Prior art keywords
- sequence number
- daily record
- ahead
- filing
- ahead daily
- 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
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/07—Responding to the occurrence of a fault, e.g. fault tolerance
- G06F11/14—Error detection or correction of the data by redundancy in operation
- G06F11/1402—Saving, restoring, recovering or retrying
- G06F11/1446—Point-in-time backing up or restoration of persistent data
- G06F11/1458—Management of the backup or restore process
- G06F11/1464—Management of the backup or restore process for networked environments
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/27—Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
Abstract
The purpose of the application is to provide a kind of method and apparatus filed for ahead daily record, specifically, master library equipment obtains the sequence number for the ahead daily record that standby library facilities is finally pulled, and as filing sequence number, the ahead journal file that sequence number is less than or equal to filing sequence number is then subjected to filing processing.Master library equipment is actively filed according to filing sequence number is got to the ahead daily record in master library equipment, ahead daily record before the ahead daily record only pulled to standby library facilities is filed, being reused for standby library facilities ahead daily record can be avoided not being synchronized to, cause it is active and standby between daily record sync break.Thus, the local storage space for depositing ahead daily record need not be increased in peak traffic, have little time the ahead daily record of filing in peak traffic and filed in time when can remain business ebb, the local memory space of master library equipment is avoided excessively to be taken, so as to cause the waste of storage resource.
Description
Technical field
The application is related to computer realm, more particularly to a kind of method and apparatus filed for ahead daily record.
Background technology
In the Database Systems of active-standby mode, standby library facilities passes through TCP (Transmission Control
Protocol, transmission control protocol) stream is from master library equipment synchrodata, to ensure that standby library facilities is set and master library equipment room data
Unanimously.For example, the database product that current industry is mostly based on postgreSQL is all based on aforesaid way to carry out same step number
According to.
In the database write operation of high concurrent, master library equipment can be allowed to produce a large amount of ahead daily record (Write in the short time
Ahead Log, WAL), it is marked after master library equipment writes an ahead daily record, has represented the ahead daily record
Through writing archive operation can be carried out to it.Under conventional configuration, master library equipment can be automatic to labeled ahead daily record
Filed, can be reused when needed, be that new ahead daily record cleans out space.In the process, standby storehouse is set
It is standby constantly to obtain ahead daily record from master library equipment, and these ahead daily records are applied so that the data of standby library facilities
Can be synchronous with master library equipment.
But, it is contemplated that the processing delay of standby library facilities (such as the network bandwidth between master library equipment and standby library facilities compared with
The speed of low or standby library facilities application ahead daily record modification data is slower), then ahead daily record is possible to also not
Reused before being pulled by standby library facilities by master library equipment, cause the ahead daily record to lose so that standby library facilities is pulled less than thinking
The ahead daily record wanted, causes the data syn-chronization of standby library facilities to interrupt.In this case, to repair it is active and standby between data not
Unanimously, it is necessary to take standby library facilities again.And this is the higher operation of a cost, it is necessary to which full dose pulls all numbers of master library equipment
According to, this can not only reduce the performance of master library equipment, and the time pulled for preserving the database of big data quantity can be very long,
If master library equipment is delayed machine during this period, it will cause the disabled risk of business based on the database.
Apply for content
The purpose of the application is to provide a kind of method and apparatus filed for ahead daily record, to solve to prewrite
Formula day aims at being reused by master library equipment before not pulled by standby library facilities, cause it is active and standby between sync break the problem of.
To achieve the above object, this application provides a kind of method filed for ahead daily record, this method includes:
The sequence number for the ahead daily record that standby library facilities is finally pulled is obtained, and regard the sequence number as filing sequence number;
The ahead journal file that sequence number is less than or equal to the filing sequence number is subjected to filing processing.
Another aspect based on the application, additionally provides a kind of master library equipment filed for ahead daily record, the master library
Equipment includes:
Labelling apparatus, the sequence number for obtaining the ahead daily record that standby library facilities is finally pulled, and using the sequence number as
File sequence number;
Filing apparatus, the ahead journal file for sequence number to be less than or equal to the filing sequence number carries out filing processing.
In addition, present invention also provides a kind of master library equipment filed for ahead daily record, including:
Processor;
And it is arranged to store the memory of computer executable instructions, the executable instruction makes institute when executed
State processor:The sequence number for the ahead daily record that standby library facilities is finally pulled is obtained, and regard the sequence number as filing sequence number;And
The ahead journal file that sequence number is less than or equal to the filing sequence number is subjected to filing processing.
Compared with prior art, the application realizes master library equipment according to prewriting that the standby library facilities got is finally pulled
The sequence number of formula daily record, actively files to the ahead daily record in master library equipment, only to prewriting that standby library facilities has been pulled
Ahead daily record before formula daily record is filed, and can be avoided not being synchronized to being reused for standby library facilities ahead daily record, be led
Daily record sync break between cause is active and standby.
In peak traffic without being increased by way of changing the configuration of ahead log space for depositing ahead day
The local storage space of will, it is to avoid the waste of storage resource, and the ahead daily record for having little time to file in peak traffic can
To remain in time to be filed during business ebb, it is to avoid database instance is restarted, so as to be impacted to regular traffic.
Brief description of the drawings
By reading the detailed description made to non-limiting example made with reference to the following drawings, the application's is other
Feature, objects and advantages will become more apparent upon:
Fig. 1 be the embodiment of the present application in be related to one master one for the Database Systems of framework schematic diagram;
A kind of flow chart for method filed for ahead daily record that Fig. 2 provides for the embodiment of the present application;
Fig. 3 is the schematic diagram for many Database Systems for frameworks of master being related in the embodiment of the present application;
Fig. 4 (a) is the schematic diagram of the ahead daily record storage condition before ahead daily record is reused;
Fig. 4 (b) is the schematic diagram of the ahead daily record storage condition after ahead daily record is reused;
A kind of structural representation for equipment filed for ahead daily record that Fig. 5 provides for the embodiment of the present application;
Same or analogous reference represents same or analogous part in accompanying drawing.
Embodiment
The application is described in further detail below in conjunction with the accompanying drawings.
In one typical configuration of the application, terminal, the equipment of service network and trusted party include one or more
Processor (CPU), input/output interface, network interface and internal memory.
Internal memory potentially includes the volatile memory in computer-readable medium, random access memory (RAM) and/or
The forms such as Nonvolatile memory, such as read-only storage (ROM) or flash memory (flash RAM).Internal memory is computer-readable medium
Example.
Computer-readable medium includes permanent and non-permanent, removable and non-removable media can be by any method
Or technology come realize information store.Information can be computer-readable instruction, data structure, the module of program or other data.
The example of the storage medium of computer includes, but are not limited to phase transition internal memory (PRAM), static RAM (SRAM), moved
State random access memory (DRAM), other kinds of random access memory (RAM), read-only storage (ROM), electric erasable
Programmable read only memory (EEPROM), fast flash memory bank or other memory techniques, read-only optical disc read-only storage (CD-ROM),
Digital versatile disc (DVD) or other optical storages, magnetic cassette tape, magnetic disk storage or other magnetic storage apparatus or
Any other non-transmission medium, the information that can be accessed by a computing device available for storage.Defined according to herein, computer
Computer-readable recording medium does not include the data-signal and carrier wave of non-temporary computer readable media (transitory media), such as modulation.
Fig. 1 shows a Database Systems, and by taking an one standby framework of master as an example, the Database Systems include a master library
Equipment 110 and a standby library facilities 120, both are connected with each other by network, wherein, the master library equipment is carrying out write operation
When, corresponding ahead daily record can be produced.It is general by the way of automatic archiving in the prior art, as the master of Database Systems
Library facilities is write after an ahead daily record, and a mark text corresponding with the ahead daily record can be produced in corresponding catalogue
Part, for ahead daily record to be marked, represents that the ahead daily record has been written into completion, can be filed.
By taking postgreSQL databases as an example, master library equipment can be produced in pg_xlog/archive_status catalogues with
The corresponding ready files of ahead daily record.After the ready files are produced, according to conventional configuration, master library equipment will be automatically right
Corresponding ahead daily record is filed, and is typically to deposit ahead daily record into the respective directories of Database Systems, and
After the completion of by ready file RNTO done files, the filing of ahead daily record is thus completed, by the pre- of done file marks
The formula journal file of writing spatially can be in limited time reused reaching.Because in peak traffic, the concurrent substantial amounts of write operation of meeting is short
Substantial amounts of ahead daily record can be generated in time, if do not drawn when a certain ahead day aiming at reusing by standby library facilities also
Take, then standby library facilities and the data syn-chronization of master library equipment will be interrupted.To avoid the ahead day for not being synchronized to standby library facilities
Will is reused, cause it is active and standby between sync break, a kind of method filed for ahead daily record of the embodiment of the present application,
Master library equipment end of this method suitable for the Database Systems of active and standby framework, specifically includes following steps:
Step S201, obtains the sequence number for the ahead daily record that standby library facilities is finally pulled, and regard the sequence number as filing
Sequence number.
Wherein, the sequence number of the ahead daily record is used to representing the genesis sequence of ahead daily record, and master library equipment prewrites
The genesis sequence of formula daily record is corresponding with the data manipulation of the ahead log recording, because standby library facilities needs are pre- according to what is pulled
Formula daily record synchrodata is write, therefore standby library facilities is when pulling the ahead daily record of master library equipment, can be according to the ahead daily record
Genesis sequence pulled, such as the serial number 001~009 of the ahead daily record in master library equipment, standby library facilities can be by
Pulled according to order by 001 ahead daily record, until pulling ultimately produce 009 ahead daily record.If current standby storehouse
Equipment has pulled 001~004 ahead daily record, then the sequence number for the ahead daily record that standby library facilities is finally pulled is
004, filing sequence number is 004.
Step S202, filing processing is carried out by the ahead journal file that sequence number is less than or equal to the filing sequence number.
Example is connected, due to filing serial number 004, represents that standby library facilities has pulled 001~004 ahead daily record,
Now it is reused also not interfering with master library equipment and standby library facilities even if the ahead daily record of 001~004 in master library equipment
Between data syn-chronization.Thus, it is possible to which the ahead journal file that sequence number is less than or equal to the filing sequence number is carried out at filing
Reason, can when needed be reused, be that new ahead daily record cleans out space.
In the technical scheme of the present embodiment, the ahead daily record that master library equipment is finally pulled according to the standby library facilities got
Sequence number, actively the ahead daily record in master library equipment is filed, the ahead daily record only pulled to standby library facilities
Ahead daily record before is filed, and can be avoided not being synchronized to being reused for standby library facilities ahead daily record, be caused active and standby
Between daily record sync break.
Conventional mode is at present:Enough spaces are reserved in master library equipment to deposit more ahead daily records, this
The time that sample reuses ahead daily record will be extended so that standby library facilities has time enough to be reused it in ahead daily record
It is preceding to be pulled, as long as therefore ensure that reserved space is sufficiently large, it is possible to ensure it is active and standby between synchronization will not interrupt.But
It is difficult to estimate daily record produced by the enough supporting business peaks in reserved great space in actual applications to be, if reserved sky
Between it is excessive, in other mosts of the time of not peak traffic, these reserved spaces can cause the waste of storage resource, unfavorable
In reducing cost.Further, since the space adjusted for depositing ahead daily record needs to restart data after modification relevant configuration
Storehouse example, therefore increase headspace in peak traffic according to the mode of dynamic adjustment, reduced at non-traffic peak pre-
Spacing, it is impossible to avoid the influence to regular traffic.
Scheme in the embodiment of the present application is in peak traffic without by way of changing the configuration of ahead log space
Increase the local storage space for depositing ahead daily record, it is to avoid the waste of storage resource, and come not in peak traffic
And the ahead daily record of filing is filed when can remain business ebb in time, it is to avoid database instance is restarted, so as to align
Normal business is impacted.
Here, it will be appreciated by those skilled in the art that master library equipment 110 in the Database Systems and standby library facilities
120 can include but is not limited to user equipment, the network equipment or user equipment and the network equipment is integrated by network and constituted
Equipment.The user equipment includes but is not limited to the realization such as personal computer, touch control terminal;The network equipment is included but not
It is limited to such as network host, single network server, multiple webserver collection or the set of computers based on cloud computing to realize.
Here, cloud is made up of a large amount of main frames or the webserver based on cloud computing (Cloud Computing), wherein, cloud computing is
One kind of Distributed Calculation, a virtual machine being made up of the computer collection of a group loose couplings.
According to actual application demand, the Database Systems can also be the how standby framework of a master, be set comprising multiple standby storehouses
Standby 120, wherein any one is for the interactive mode between library facilities and master library equipment, with an one standby framework class of master in this example
Seemingly.Under the how standby framework of a master, the step S201 is specifically included:Obtain the ahead that multiple standby library facilities are finally pulled
The sequence number of daily record, and it regard the wherein minimum sequence number as filing sequence number.
Fig. 3 shows a kind of Database Systems of many standby frameworks of a master, including three standby library facilities 120A, 120B and
120C, master library equipment 110 ought obtain the sequence number of these three ahead daily records finally pulled for library facilities respectively, due to master library
Equipment is different for the disposal ability of the network condition between library facilities and three standby library facilities itself from these three, standby library facilities
The serial number 004 for the ahead daily record that 120A is finally pulled, the serial number for the ahead daily record that standby library facilities 120B is finally pulled
006, the serial number 003 for the ahead daily record that standby library facilities 120C is finally pulled.In order to ensure that standby library facilities 120C data are same
Step is not interrupted, and master library equipment can only file to 001~003 ahead daily record, without to 004 and its ahead afterwards
Daily record is filed, it is to avoid because 004 and its ahead daily record afterwards be reused, cause standby library facilities 120C not to be smoothed out
Data syn-chronization.
Further, in the present embodiment can be by obtaining the file recipe for the ahead daily record pulled in library facilities
Formula obtains the sequence number for the ahead daily record that standby library facilities is finally pulled, can be in master library by taking postgreSQL databases as an example
Following sentence is performed in equipment:Select client_addr, pg_xlogfile_name (sent_location) from pg_
Stat_replication, thus gets the ahead daily record that is pulled in each standby library facilities being connected with the master library equipment
Filename, is the sequence number for representing the ahead daily record that standby library facilities is finally pulled in postgreSQL database file names.By
This, obtains the sequence number for the ahead daily record that standby library facilities is finally pulled, specifically includes in the step S201:Obtain standby library facilities
In the filename of ahead daily record that pulls, the ahead daily record that the standby library facilities is finally pulled is determined according to the filename
Sequence number.
Further, the detailed process for processing being filed in step S202 can be in the following ways:Sequence number is less than or equal to
The ahead daily record of the filing sequence number is copied to predeterminated position, and is to have filed state by its corresponding status indication.
Wherein, the predeterminated position refers to be different from the storage location of the assigned catalogue inside Database Systems, Ke Yishi
The storage location of external system, for example, be copied to OSS (Object Storage Service, object storage by ahead daily record
Service) platform, the storage resource of Database Systems in itself thus can be not only saved, it is also possible that this programme prewrites in increase
During the memory space of formula daily record, without the configuration file by changing Database Systems, can automatically it increase in peak traffic
The space for the ahead daily record do not filed in master library equipment, without restarting database instance, is impacted to normal business.
And every corresponding status indication of ahead daily record can use corresponding with ahead daily record in particular category
The form of file, such as with reference to postgreSQL databases, using the ready in pg_xlog/archive_status catalogues
The tab file that file is not filed as expression, done files are used as the filed tab file of expression.Therefore, by ahead day
It can repair the corresponding tab file for representing not file of ahead daily record when having filed state that the corresponding status indication of will, which is,
It is changed to represent filed tab file, such as by ready file RNTO done files.
Because the archiving policies of the master library equipment of most of Database Systems are the strategies using automatic archiving.With
Exemplified by postgreSQL databases, by the way that archive_mode parameters are set into configuration file postgresql.conf
Open its filing function, and configure archive_command parameters, whenever master library equipment writes an ahead daily record,
Generated in its pg_xlog/archive_status catalogue after a corresponding ready file, can be automatic to corresponding ahead
Daily record is filed, by its ready file RNTO done file.
Therefore, being improved to existing Database Systems with realize the embodiment of the present application provide archiving method when,
Need before the sequence number for the ahead daily record that standby library facilities is finally pulled is obtained, configure control parameter, stop to arbitrarily prewriting
Formula daily record carries out automatic archiving processing.Still by taking postgreSQL databases as an example, by configuration file postgresql.conf
It is middle archive_mode parameters are set on to open its filing function, but it is not provided with archive_command parameters so that it is main
Library facilities can produce ready files after ahead daily record is write, but corresponding ahead daily record will not be returned automatically
Shelves, by its ready file RNTO done file.
Further, the method filed for ahead daily record also includes:It is described sequence number is less than or equal to it is described
After the ahead daily record progress filing processing for filing sequence number, the ahead daily record for having completed filing processing is reused.
By taking an one standby Database Systems of master as an example, if the serial number for the ahead daily record that master library equipment has currently write
001~020, the serial number 010 for the ahead daily record that standby library facilities is finally made a return journey, the filing sequence number thereby determined that is 010.
, can be in the space for depositing ahead daily record after filing to 001~010 ahead daily record in practical application
Man Shi, the ahead daily record that these have been filed is reused, to clean out memory space.For example, when master library equipment writes
During 020 ahead daily record, its space is full, and in order to not influence the generation of new ahead daily record, master library equipment can be according to suitable
(order according to 001 to 010) is reused in the ahead daily record that ordered pair has been filed, straight when generating new ahead daily record
Connect the space using the ahead daily record filed.For example, cleaning 001 ahead daily record content with generate 021 it is pre-
Formula daily record is write, storage condition such as Fig. 4 (a) and Fig. 4 of the ahead daily record before and after 001 ahead daily record is reused
(b) shown in.
Another aspect based on the application, the embodiment of the present application, which is additionally provided, a kind of as shown in Figure 5 is used for ahead
The master library equipment of daily record filing, the master library equipment is applied to the Database Systems of the active and standby framework shown in Fig. 1, including labelling apparatus
510 and filing apparatus 520.
Specifically, the labelling apparatus 510 is used for the sequence number for obtaining the ahead daily record that standby library facilities is finally pulled, and will
The sequence number is used as filing sequence number.Wherein, the sequence number of the ahead daily record is used for the genesis sequence for representing ahead daily record, main
The genesis sequence of the ahead daily record of library facilities is corresponding with the data manipulation of the ahead log recording, because standby library facilities needs
According to the ahead daily record synchrodata pulled, therefore standby library facilities is when pulling the ahead daily record of master library equipment, can basis
The genesis sequence of the ahead daily record is pulled, such as the serial number 001~009 of the ahead daily record in master library equipment,
Standby library facilities can be pulled by 001 ahead daily record in sequence, until pulling 009 ahead day ultimately produced
Will.If current standby library facilities has pulled 001~004 ahead daily record, then the ahead that standby library facilities is finally pulled
The sequence number of daily record is 004, and filing sequence number is 004.
The filing apparatus 520 is used to be filed the ahead journal file that sequence number is less than or equal to the filing sequence number
Processing.Example is connected, due to filing serial number 004, represents that standby library facilities has pulled 001~004 ahead daily record, now
It is reused also not interfering between master library equipment and standby library facilities even if the ahead daily record of 001~004 in master library equipment
Data syn-chronization.Thus, it is possible to which the ahead journal file that sequence number is less than or equal to the filing sequence number is carried out into filing processing, make
It can be reused when needed, be that new ahead daily record cleans out space.
The technical scheme of the present embodiment realizes the ahead that master library equipment is finally pulled according to the standby library facilities got
The sequence number of daily record, actively files to the ahead daily record in master library equipment, the ahead only pulled to standby library facilities
Ahead daily record before daily record is filed, and can be avoided not being synchronized to being reused for standby library facilities ahead daily record, be caused
Daily record sync break between active and standby.
Conventional mode is at present:Enough spaces are reserved in master library equipment to deposit more ahead daily records, this
The time that sample reuses ahead daily record will be extended so that standby library facilities has time enough to be reused it in ahead daily record
It is preceding to be pulled, as long as therefore ensure that reserved space is sufficiently large, it is possible to ensure it is active and standby between synchronization will not interrupt.But
It is difficult to estimate daily record produced by the enough supporting business peaks in reserved great space in actual applications to be, if reserved sky
Between it is excessive, in other mosts of the time of not peak traffic, these reserved spaces can cause the waste of storage resource, unfavorable
In reducing cost.Further, since the space adjusted for depositing ahead daily record needs to restart data after modification relevant configuration
Storehouse example, therefore increase headspace in peak traffic according to the mode of dynamic adjustment, reduced at non-traffic peak pre-
Spacing, it is impossible to avoid the influence to regular traffic.
The side that scheme in the embodiment of the present application is configured in peak traffic by traditional modification ahead log space
Formula increases the local storage space for depositing ahead daily record, it is to avoid the waste of storage resource, and comes in peak traffic
Ahead daily record not as good as filing is filed in time when can remain business ebb, it is to avoid database instance is restarted, so that right
Regular traffic is impacted.
Here, it will be appreciated by those skilled in the art that master library equipment 110 in the Database Systems and standby library facilities
120 can include but is not limited to user equipment, the network equipment or user equipment and the network equipment is integrated by network and constituted
Equipment.The user equipment includes but is not limited to the realization such as personal computer, touch control terminal;The network equipment is included but not
It is limited to such as network host, single network server, multiple webserver collection or the set of computers based on cloud computing to realize.
Here, cloud is made up of a large amount of main frames or the webserver based on cloud computing (Cloud Computing), wherein, cloud computing is
One kind of Distributed Calculation, a virtual machine being made up of the computer collection of a group loose couplings.
According to actual application demand, the Database Systems can also be the how standby framework of a master, be set comprising multiple standby storehouses
Standby 120, wherein any one is for the interactive mode between library facilities and master library equipment, with an one standby framework class of master in this example
Seemingly.Under the how standby framework of a master, the labelling apparatus 510 is specifically for obtaining the ahead that multiple standby library facilities are finally pulled
The sequence number of daily record, and it regard the wherein minimum sequence number as filing sequence number.
Fig. 3 shows a kind of Database Systems of many standby frameworks of a master, including three standby library facilities 120A, 120B and
120C, master library equipment 110 ought obtain the sequence number of these three ahead daily records finally pulled for library facilities respectively, due to master library
Equipment is different for the disposal ability of the network condition between library facilities and three standby library facilities itself from these three, standby library facilities
The serial number 004 for the ahead daily record that 120A is finally pulled, the serial number for the ahead daily record that standby library facilities 120B is finally pulled
006, the serial number 003 for the ahead daily record that standby library facilities 120C is finally pulled.In order to ensure that standby library facilities 120C data are same
Step is not interrupted, and master library equipment can only file to 001~003 ahead daily record, without to 004 and its ahead afterwards
Daily record is filed, it is to avoid because 004 and its ahead daily record afterwards be reused, cause standby library facilities 120C not to be smoothed out
Data syn-chronization.
Further, in the present embodiment can be by obtaining the file recipe for the ahead daily record pulled in library facilities
Formula obtains the sequence number for the ahead daily record that standby library facilities is finally pulled, can be in master library by taking postgreSQL databases as an example
Following sentence is performed in equipment:Select client_addr, pg_xlogfile_name (sent_location) from pg_
Stat_replication, thus gets the ahead daily record that is pulled in each standby library facilities being connected with the master library equipment
Filename, is the sequence number for representing the ahead daily record that standby library facilities is finally pulled in postgreSQL database file names.By
This, the labelling apparatus 510 is when obtaining the sequence number for the ahead daily record that standby library facilities is finally pulled, specifically for obtaining standby storehouse
The filename of the ahead daily record pulled in equipment, the ahead that the standby library facilities is finally pulled is determined according to the filename
The sequence number of daily record.
Further, the detailed process of the progress of the labelling apparatus 520 filing processing can be in the following ways:By sequence number
Ahead daily record less than or equal to the filing sequence number is copied to predeterminated position, and is to have filed shape by its corresponding status indication
State.
Wherein, the predeterminated position refers to be different from the storage location of the assigned catalogue inside Database Systems, Ke Yishi
The storage location of external system, for example, be copied to OSS (Object Storage Service, object storage by ahead daily record
Service) platform, the storage resource of Database Systems in itself thus can be not only saved, it is also possible that this programme prewrites in increase
During the memory space of formula daily record, without the configuration file by changing Database Systems, can automatically it increase in peak traffic
The space for the ahead daily record do not filed in master library equipment, without restarting database instance, shadow is caused to normal business
Ring..
And every corresponding status indication of ahead daily record can use corresponding with ahead daily record in particular category
The form of file, such as with reference to postgreSQL databases, using the ready in pg_xlog/archive_status catalogues
The tab file that file is not filed as expression, done files are used as the filed tab file of expression.Therefore, by ahead day
It can repair the corresponding tab file for representing not file of ahead daily record when having filed state that the corresponding status indication of will, which is,
It is changed to represent filed tab file, such as by ready file RNTO done files.
Because the archiving policies of the master library equipment of most of Database Systems are the strategies using automatic archiving.With
Exemplified by postgreSQL databases, by the way that archive_mode parameters are set into configuration file postgresql.conf
Open its filing function, and configure archive_command parameters, whenever master library equipment writes an ahead daily record,
Generated in its pg_xlog/archive_status catalogue after a corresponding ready file, can be automatic to corresponding ahead
Daily record is filed, by its ready file RNTO done file.
Therefore, the embodiment of the present application provides a kind of master library equipment for being preferably used in ahead daily record filing, except Fig. 5 institutes
Outside the labelling apparatus and filing apparatus that show, in addition to configuration device.The configuration device, for obtaining standby library facilities most post-tensioning
Before the sequence number of the ahead daily record taken, control parameter is configured, stops carrying out automatic archiving processing to any ahead daily record.Still
By taking postgreSQL databases as an example, by the way that archive_mode parameters are set in configuration file postgresql.conf
On opens its filing function, but is not provided with archive_command parameters so that master library equipment is after ahead daily record is write
Ready files can be produced, but corresponding ahead daily record will not be filed automatically, by its ready file RNTO
Done files.
Further, the master library equipment filed for ahead daily record also includes a reuse device, the reuse device
After carrying out filing processing in the ahead daily record that sequence number is less than or equal to the filing sequence number, reuse has completed to return
The ahead daily record of shelves processing.
By taking an one standby Database Systems of master as an example, if the serial number for the ahead daily record that master library equipment has currently write
001~020, the serial number 010 for the ahead daily record that standby library facilities is finally made a return journey, the filing sequence number thereby determined that is 010.
, can be in the sky for depositing ahead daily record after filing to 001~010 ahead daily record in practical application
Between it is full when, the ahead daily record that these have been filed is reused, to clean out memory space.For example, when master library equipment is write
During complete 020 ahead daily record, its space is full, in order to not influence the generation of new ahead daily record, and master library equipment can be according to
(order according to 001 to 010) is reused to the ahead daily record filed in order, when generating new ahead daily record
Directly using the space for the ahead daily record filed.For example, clearing up the content of 001 ahead daily record to generate 021
Ahead daily record.
In addition, the embodiment of the present application additionally provides another master library equipment filed for ahead daily record, including:
Processor;
And it is arranged to store the memory of computer executable instructions, the executable instruction makes institute when executed
State processor:The sequence number for the ahead daily record that standby library facilities is finally pulled is obtained, and regard the sequence number as filing sequence number;And
The ahead journal file that sequence number is less than or equal to the filing sequence number is subjected to filing processing.
In summary, in this programme the ahead daily record that master library equipment is finally pulled according to the standby library facilities got sequence
Number, actively the ahead daily record in master library equipment is filed, before the ahead daily record only pulled to standby library facilities
Ahead daily record filed, can avoid not being synchronized to being reused for standby library facilities ahead daily record, cause it is active and standby between
Daily record sync break.Because the processing of business always has peak traffic and business ebb, in peak traffic not as good as filing
Filed in time when ahead daily record can remain business ebb, therefore without passing through traditional modification ahead log space
The ahead daily record that the mode of configuration is largely produced when master library equipment increases for tackling peak traffic in the short time it is local
Memory space, so as to avoid restarting database instance, so as to impact regular traffic.
It should be noted that the application can be carried out in the assembly of software and/or software and hardware, for example, can adopt
Realized with application specific integrated circuit (ASIC), general purpose computer or any other similar hardware device.In one embodiment
In, the software program of the application can realize steps described above or function by computing device.Similarly, the application
Software program (including related data structure) can be stored in computer readable recording medium storing program for performing, for example, RAM memory,
Magnetically or optically driver or floppy disc and similar devices.In addition, some steps or function of the application can employ hardware to realize, example
Such as, as coordinating with processor so as to performing the circuit of each step or function.
In addition, the part of the application can be applied to computer program product, such as computer program instructions, when its quilt
When computer is performed, by the operation of the computer, it can call or provide according to the present processes and/or technical scheme.
And the programmed instruction of the present processes is called, it is possibly stored in fixed or moveable recording medium, and/or pass through
Broadcast or the data flow in other signal bearing medias and be transmitted, and/or be stored according to described program instruction operation
In the working storage of computer equipment.Here, including a device according to one embodiment of the application, the device includes using
In the memory and processor for execute program instructions of storage computer program instructions, wherein, when the computer program refers to
When order is by the computing device, method and/or skill of the plant running based on foregoing multiple embodiments according to the application are triggered
Art scheme.
It is obvious to a person skilled in the art that the application is not limited to the details of above-mentioned one exemplary embodiment, Er Qie
In the case of without departing substantially from spirit herein or essential characteristic, the application can be realized in other specific forms.Therefore, no matter
From the point of view of which point, embodiment all should be regarded as exemplary, and be nonrestrictive, scope of the present application is by appended power
Profit is required rather than described above is limited, it is intended that all in the implication and scope of the equivalency of claim by falling
Change is included in the application.Any reference in claim should not be considered as to the claim involved by limitation.This
Outside, it is clear that the word of " comprising " one is not excluded for other units or step, and odd number is not excluded for plural number.That is stated in device claim is multiple
Unit or device can also be realized by a unit or device by software or hardware.The first, the second grade word is used for table
Show title, and be not offered as any specific order.
Claims (15)
1. a kind of method filed for ahead daily record, wherein, this method includes:
The sequence number for the ahead daily record that standby library facilities is finally pulled is obtained, and regard the sequence number as filing sequence number;
The ahead journal file that sequence number is less than or equal to the filing sequence number is subjected to filing processing.
2. according to the method described in claim 1, wherein, obtain the sequence number for the ahead daily record that standby library facilities is finally pulled, bag
Include:
The filename of the ahead daily record pulled in standby library facilities is obtained, determines that the standby library facilities is last according to the filename
The sequence number of the ahead daily record pulled.
3. according to the method described in claim 1, wherein, obtain the sequence number for the ahead daily record that standby library facilities is finally pulled, and
Using the sequence number as filing sequence number, including:
The sequence number for the ahead daily record that multiple standby library facilities are finally pulled is obtained, and regard the wherein minimum sequence number as filing
Sequence number.
4. according to the method in any one of claims 1 to 3, wherein, by sequence number be less than or equal to it is described filing sequence number it is pre-
Write formula daily record and carry out filing processing, including:
The ahead daily record that sequence number is less than or equal to the filing sequence number is copied to predeterminated position, and by its corresponding status indication
To have filed state.
5. method according to claim 4, wherein, the ahead daily record that sequence number is less than or equal to the filing sequence number is copied
It is to have filed state to predeterminated position, and by its corresponding status indication, including:
The ahead daily record that sequence number is less than or equal to the filing sequence number is copied to predeterminated position, and its corresponding expression is not returned
The tab file of shelves is revised as representing filed tab file.
6. according to the method described in claim 1, wherein, obtain the ahead daily record that standby library facilities is finally pulled sequence number it
Before, in addition to:
Control parameter is configured, stops carrying out automatic archiving processing to any ahead daily record.
7. according to the method described in claim 1, wherein, by sequence number be less than or equal to it is described filing sequence number ahead daily record carry out
After filing processing, in addition to:
Reuse the ahead daily record for having completed filing processing.
8. a kind of master library equipment filed for ahead daily record, wherein, the master library equipment includes:
Labelling apparatus, for obtaining the sequence number for the ahead daily record that standby library facilities is finally pulled, and regard the sequence number as filing
Sequence number;
Filing apparatus, the ahead journal file for sequence number to be less than or equal to the filing sequence number carries out filing processing.
9. master library equipment according to claim 8, wherein, the labelling apparatus, for obtaining what is pulled in standby library facilities
The filename of ahead daily record, the sequence number for the ahead daily record that the standby library facilities is finally pulled is determined according to the filename,
And it regard the sequence number as filing sequence number.
10. master library equipment according to claim 8, wherein, the labelling apparatus is last for obtaining multiple standby library facilities
The sequence number of the ahead daily record pulled, and it regard the wherein minimum sequence number as filing sequence number.
11. the master library equipment according to any one of claim 8 to 10, wherein, the filing apparatus, for sequence number is small
Predeterminated position is copied in the ahead daily record equal to the filing sequence number, and is to have filed shape by its corresponding status indication
State.
12. master library equipment according to claim 11, wherein, the filing apparatus is described for sequence number to be less than or equal to
The ahead daily record of filing sequence number is copied to predeterminated position, and its corresponding tab file for representing not file is revised as representing
Filed tab file.
13. master library equipment according to claim 8, wherein, the master library equipment also includes:
Configuration device, for before the sequence number for the ahead daily record that standby library facilities is finally pulled is obtained, configuring control parameter, stopping
Automatic archiving processing only is carried out to any ahead daily record.
14. master library equipment according to claim 8, wherein, the master library equipment also includes:
Reuse device, for sequence number being less than or equal to after the ahead daily record progress filing processing of the filing sequence number, weight
With the ahead daily record for having completed filing processing.
15. a kind of master library equipment filed for ahead daily record, wherein, including:
Processor;
And it is arranged to store the memory of computer executable instructions, the executable instruction makes the place when executed
Manage device:The sequence number for the ahead daily record that standby library facilities is finally pulled is obtained, and regard the sequence number as filing sequence number;And by sequence
Number be less than or equal to it is described filing sequence number ahead journal file carry out filing processing.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN2016101149351 | 2016-03-01 | ||
CN201610114935 | 2016-03-01 |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107145499A true CN107145499A (en) | 2017-09-08 |
Family
ID=59783775
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710117680.9A Pending CN107145499A (en) | 2016-03-01 | 2017-03-01 | The method and apparatus filed for ahead daily record |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107145499A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109634930A (en) * | 2018-10-26 | 2019-04-16 | 北京辰森世纪科技股份有限公司 | Clear up method and device, the storage medium, electronic device of log |
CN109684132A (en) * | 2018-12-20 | 2019-04-26 | 努比亚技术有限公司 | A kind of data back up method of mobile terminal, mobile terminal and storage medium |
WO2019228369A1 (en) * | 2018-05-29 | 2019-12-05 | Oppo广东移动通信有限公司 | Message processing method and related product |
CN111258814A (en) * | 2020-01-13 | 2020-06-09 | 苏州浪潮智能科技有限公司 | Database backup fault tolerance method, system, terminal and storage medium |
CN111581154A (en) * | 2019-02-19 | 2020-08-25 | 三星电子株式会社 | Electronic device and method for managing database |
WO2021174537A1 (en) * | 2020-03-06 | 2021-09-10 | 深圳市欢太科技有限公司 | Data transmission method and apparatus |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101751394A (en) * | 2008-12-16 | 2010-06-23 | 青岛海信传媒网络技术有限公司 | Method and system for synchronizing data |
CN104809033A (en) * | 2014-01-27 | 2015-07-29 | 中国移动通信集团河南有限公司 | Backup method and system |
-
2017
- 2017-03-01 CN CN201710117680.9A patent/CN107145499A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101751394A (en) * | 2008-12-16 | 2010-06-23 | 青岛海信传媒网络技术有限公司 | Method and system for synchronizing data |
CN104809033A (en) * | 2014-01-27 | 2015-07-29 | 中国移动通信集团河南有限公司 | Backup method and system |
Non-Patent Citations (1)
Title |
---|
美国微软公司: "《部署Microsoft SQL Server 7.0》", 31 July 2000, 人民邮电出版社 * |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019228369A1 (en) * | 2018-05-29 | 2019-12-05 | Oppo广东移动通信有限公司 | Message processing method and related product |
CN109634930A (en) * | 2018-10-26 | 2019-04-16 | 北京辰森世纪科技股份有限公司 | Clear up method and device, the storage medium, electronic device of log |
CN109634930B (en) * | 2018-10-26 | 2020-12-04 | 北京辰森世纪科技股份有限公司 | Method and device for cleaning logs, storage medium and electronic device |
CN109684132A (en) * | 2018-12-20 | 2019-04-26 | 努比亚技术有限公司 | A kind of data back up method of mobile terminal, mobile terminal and storage medium |
CN109684132B (en) * | 2018-12-20 | 2023-03-10 | 湖南半岛医疗科技有限公司 | Data backup method of mobile terminal, mobile terminal and storage medium |
CN111581154A (en) * | 2019-02-19 | 2020-08-25 | 三星电子株式会社 | Electronic device and method for managing database |
CN111581154B (en) * | 2019-02-19 | 2023-08-25 | 三星电子株式会社 | Electronic device and method for managing a database |
CN111258814A (en) * | 2020-01-13 | 2020-06-09 | 苏州浪潮智能科技有限公司 | Database backup fault tolerance method, system, terminal and storage medium |
CN111258814B (en) * | 2020-01-13 | 2022-08-05 | 苏州浪潮智能科技有限公司 | Database backup fault tolerance method, system, terminal and storage medium |
WO2021174537A1 (en) * | 2020-03-06 | 2021-09-10 | 深圳市欢太科技有限公司 | Data transmission method and apparatus |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107145499A (en) | The method and apparatus filed for ahead daily record | |
US11768739B2 (en) | Manifest-based snapshots in distributed computing environments | |
US20170220614A1 (en) | Consistent ring namespaces facilitating data storage and organization in network infrastructures | |
US8856080B2 (en) | Backup using metadata virtual hard drive and differential virtual hard drive | |
US8090917B2 (en) | Managing storage and migration of backup data | |
EP2288975B1 (en) | Method for optimizing cleaning of maps in flashcopy cascades containing incremental maps | |
CN105718548B (en) | Based on the system and method in de-duplication storage system for expansible reference management | |
US7213116B2 (en) | Method and apparatus for mirroring objects between storage systems | |
CN101577735B (en) | Method, device and system for taking over fault metadata server | |
CN103780638B (en) | Method of data synchronization and system | |
CN103150402B (en) | Virtual File System based on index coding and method for building up, access method | |
CN102033889A (en) | Distributed database parallel processing system | |
US11397749B2 (en) | Asynchronous replication of in-scope table data | |
CN102272751A (en) | Data integrity in a database environment through background synchronization | |
JP2007041888A (en) | Database restructuring device and database restructuring program | |
CN103246549A (en) | Method and system for data transfer | |
JP5556025B2 (en) | Storage system | |
US8589652B2 (en) | Reorganization of a fragmented directory of a storage data structure comprised of the fragmented directory and members | |
CN113590596A (en) | Data processing method, system, device, computer program product and storage medium | |
CN109299059A (en) | File storage, search method, device, storage medium and server | |
CN112199329A (en) | Double-machine operation and maintenance data filing and cleaning method and equipment based on fortress machine | |
CN107491264A (en) | Method for writing data and device in a kind of distributed system | |
CN109947704A (en) | A kind of lock type switching method, device and cluster file system | |
CN202856790U (en) | Semantic web data storage system | |
CN114860657A (en) | Configuration file synchronization method and device, electronic equipment and medium |
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: 20170908 |
|
RJ01 | Rejection of invention patent application after publication |