CN109271399A - A kind of method of calibration of database write-in log consistency - Google Patents

A kind of method of calibration of database write-in log consistency Download PDF

Info

Publication number
CN109271399A
CN109271399A CN201811391098.2A CN201811391098A CN109271399A CN 109271399 A CN109271399 A CN 109271399A CN 201811391098 A CN201811391098 A CN 201811391098A CN 109271399 A CN109271399 A CN 109271399A
Authority
CN
China
Prior art keywords
data
write
calibration
database
consistency
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
CN201811391098.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.)
Wuhan Dameng Database Co Ltd
Original Assignee
Wuhan Dameng Database 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 Wuhan Dameng Database Co Ltd filed Critical Wuhan Dameng Database Co Ltd
Priority to CN201811391098.2A priority Critical patent/CN109271399A/en
Publication of CN109271399A publication Critical patent/CN109271399A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0727Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a storage system, e.g. in a DASD or network based storage system

Abstract

The present invention discloses a kind of method of calibration of database journal write-in consistency, comprising the following steps: step S1, obtains the data D1 that write operation needs brush, obtains the data length N of the data D1;Step S2, at the offset F of journal file, the data D1 is written;Step S3, at the offset F of the journal file, the data D2 that length is N is read;Step S4, the data D1 and data D2 is compared, re-writes the data D1 at the offset F of the journal file if it is inconsistent, going to step S2.The method of calibration of database journal write-in consistency provided by the invention may insure that the data of write-in journal file and expected content are completely the same, prevent the data movement caused by other read operations.

Description

A kind of method of calibration of database write-in log consistency
Technical field
The present invention relates to database journal write operation consistency technical fields, and in particular to a kind of database write-in log one The method of calibration of cause property.
Background technique
A log crawl process can be arranged in the scheme based on heterogeneous database real-time synchronization, on source database, Reading is constantly scanned to the online log of database, so that the running log progress data for grabbing database at the first time are same Step.The journal file that this framework will cause database is opened simultaneously by multiple processes, and day is written into journal file for database Will, and data synchronizing process is then that log is read in journal file, if read and the operation write while concurrently in the same day In the same file offset of will file, it is possible to will cause conflict.The new data for causing database that will be written is by log text The legacy data read in part washes out, the legacy data in be actually written into or journal file.By test, this phenomenon is virtual Probability is very high under the running environment of machine, once occurring, will lead to the synchronous error of data, more seriously, if at this moment Database failure is restarted, and database will be unable to be restored using this REDO log being destroyed.
Summary of the invention
It is an object of the invention to overcome above-mentioned technical deficiency, a kind of verification side of database journal write-in consistency is provided Method solves same file of the read operation in the same journal file of the write operation and synchronizing software of database in the prior art It in offset, causes to conflict, read operation can destroy the data of write operation brush, lead to that the inconsistent technical problem of data is written.
To reach above-mentioned technical purpose, technical solution of the present invention provides a kind of verification of database journal write-in consistency Method, comprising the following steps:
Step S1, the data D1 that write operation needs brush is obtained, the data length N of the data D1 is obtained;
Step S2, at the offset F of journal file, the data D1 is written;
Step S3, at the offset F of the journal file, the data D2 that length is N is read;
Step S4, the data D1 and data D2 is compared, if it is inconsistent, going to step S2 for data D1 weight It is newly written at the offset F of the journal file.
Compared with prior art, the beneficial effect comprise that the mistake of journal file is written in daily record data by the present invention It joined reading verification step in journey, after writing the data, read the corresponding data of writing position immediately, and will read Data are compared with write-in data, are re-write if inconsistent.This scheme may insure the number of write-in journal file According to completely the same with expected content, the data movement caused by other read operations is prevented.
Detailed description of the invention
Fig. 1 is the flow chart of the method for calibration of database journal write-in consistency provided by the invention.
Specific embodiment
In order to make the objectives, technical solutions, and advantages of the present invention clearer, with reference to the accompanying drawings and embodiments, right The present invention is further elaborated.It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, and It is not used in the restriction present invention.
Embodiment 1:
As shown in Figure 1, the embodiment of the present invention 1 provides a kind of method of calibration of database journal write-in consistency, packet Include following steps:
Step S1, the data D1 that write operation needs brush is obtained, the data length N of the data D1 is obtained;
Step S2, at the offset F of journal file, the data D1 is written;
Step S3, at the offset F of the journal file, the data D2 that length is N is read;
Step S4, the data D1 and data D2 is compared, if it is inconsistent, going to step S2 for data D1 weight It is newly written at the offset F of the journal file.
The method of calibration of database journal write-in consistency provided by the invention has adjusted database write-in daily record data Step increases during journal file is written in daily record data and reads verification step, and in journal file, some offset write-in is a piece of After data, the data at this document same offset are read at once into memory, then the data for the data and reading being just written It is compared, rewrites daily record data in identical deviation post if inconsistent, compared after then reading again, repeat this Movement, after comparing is consistent.
The method of calibration of database journal write-in consistency provided by the invention may insure the data of write-in journal file It is completely the same with expected content, it prevents because of other read operations, such as the read operation in data synchronization process, the data of initiation become It is dynamic.Present invention enhances the write operations of database, verify to the daily record data of database write-in, when the data of discovery write-in It when with being expected not being inconsistent, being written again, ensure that the correctness of write-in data.
Preferably, the step S1 from daily record data queue specifically, obtain the data D1.
The data D1 for needing brush is obtained from daily record data queue, is convenient for subsequent write operation and contrast operation.
Preferably, the step S4 further include: if the step D1 is consistent with the data D2, go to step S1 progress The journalizing of next data.
If data D1 is consistent with data D2, illustrate that write operation is errorless, the log write-in behaviour of next data can be carried out The consistency contrast operation of work and next data, to guarantee the write-in consistency of each data.
Embodiment 2:
The embodiment of the present invention 2 provides a kind of computer storage medium, is stored thereon with computer program, the calculating When machine program is executed by processor, the method for calibration of the write-in consistency of database journal described in any of the above embodiment is realized.
Method of calibration of the computer storage medium provided by the invention based on above-mentioned database journal write-in consistency, because This, the technical effect that the method for calibration of above-mentioned database journal write-in consistency has, computer storage medium is likewise supplied with, Details are not described herein.
The above described specific embodiments of the present invention are not intended to limit the scope of the present invention..Any basis Any other various changes and modifications that technical concept of the invention is made should be included in the guarantor of the claims in the present invention It protects in range.

Claims (4)

1. a kind of method of calibration of database journal write-in consistency, which comprises the following steps:
Step S1, the data D1 that write operation needs brush is obtained, the data length N of the data D1 is obtained;
Step S2, at the offset F of journal file, the data D1 is written;
Step S3, at the offset F of the journal file, the data D2 that length is N is read;
Step S4, the data D1 and data D2 is compared, writes the data D1 again if it is inconsistent, going to step S2 Enter at the offset F of the journal file.
2. the method for calibration of database journal write-in consistency according to claim 1, which is characterized in that the step S1 Specifically, obtaining the data D1 from daily record data queue.
3. the method for calibration of database journal write-in consistency according to claim 1, which is characterized in that the step S4 If further include: the step D1 is consistent with the data D2, goes to step the write operation that S1 carries out next data.
4. a kind of computer storage medium, is stored thereon with computer program, which is characterized in that the computer program is processed When device executes, the method for calibration of database journal write-in consistency a method according to any one of claims 1-3 is realized.
CN201811391098.2A 2018-11-19 2018-11-19 A kind of method of calibration of database write-in log consistency Pending CN109271399A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811391098.2A CN109271399A (en) 2018-11-19 2018-11-19 A kind of method of calibration of database write-in log consistency

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811391098.2A CN109271399A (en) 2018-11-19 2018-11-19 A kind of method of calibration of database write-in log consistency

Publications (1)

Publication Number Publication Date
CN109271399A true CN109271399A (en) 2019-01-25

Family

ID=65191243

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811391098.2A Pending CN109271399A (en) 2018-11-19 2018-11-19 A kind of method of calibration of database write-in log consistency

Country Status (1)

Country Link
CN (1) CN109271399A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110347746A (en) * 2019-06-13 2019-10-18 武汉达梦数据库有限公司 A kind of heterogeneous database synchrodata consistency desired result method and device
CN111858502A (en) * 2020-06-02 2020-10-30 武汉达梦数据库有限公司 Log reading method and log reading synchronization system based on log analysis synchronization

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105045721A (en) * 2015-07-23 2015-11-11 浪潮电子信息产业股份有限公司 Method and device for checking data consistency
CN105653579A (en) * 2015-12-18 2016-06-08 北京百度网讯科技有限公司 Method and device for testing distributed transactions
CN106709069A (en) * 2017-01-25 2017-05-24 焦点科技股份有限公司 High-reliability big data logging collection and transmission method
CN107632781A (en) * 2017-08-28 2018-01-26 深圳市云舒网络技术有限公司 A kind of method and storage architecture of the more copy rapid verification uniformity of distributed storage

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105045721A (en) * 2015-07-23 2015-11-11 浪潮电子信息产业股份有限公司 Method and device for checking data consistency
CN105653579A (en) * 2015-12-18 2016-06-08 北京百度网讯科技有限公司 Method and device for testing distributed transactions
CN106709069A (en) * 2017-01-25 2017-05-24 焦点科技股份有限公司 High-reliability big data logging collection and transmission method
CN107632781A (en) * 2017-08-28 2018-01-26 深圳市云舒网络技术有限公司 A kind of method and storage architecture of the more copy rapid verification uniformity of distributed storage

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
用电热毯烤猪: "数据校验的六种方式", 《HTTPS://WWW.JIANSHU.COM/P/469EA0A55A1D》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110347746A (en) * 2019-06-13 2019-10-18 武汉达梦数据库有限公司 A kind of heterogeneous database synchrodata consistency desired result method and device
CN111858502A (en) * 2020-06-02 2020-10-30 武汉达梦数据库有限公司 Log reading method and log reading synchronization system based on log analysis synchronization

Similar Documents

Publication Publication Date Title
WO2019085466A1 (en) Association test method and system, application server, and computer readable storage medium
CN102841832B (en) Error memory chip locating method
CN110008129B (en) Reliability test method, device and equipment for storage timing snapshot
CN106445815B (en) A kind of automated testing method and device
WO2018177205A1 (en) Regression testing method, device, computer apparatus, and storage medium
CN109271399A (en) A kind of method of calibration of database write-in log consistency
CN110147354B (en) Batch data editing method, device, computer equipment and storage medium
WO2015116125A1 (en) File system analysis in user daemon
CN103279408B (en) The method of testing of raid-array RAID performance
CN106874173B (en) Page template testing method and device
CN109614119B (en) Burning method, device, electronic equipment and medium
CN112948473A (en) Data processing method, device and system of data warehouse and storage medium
CN107506307A (en) DMI method for refreshing and system in a kind of storage product test
CN109445800A (en) A kind of version automatic deployment method and system based on distributed system
CN106547658A (en) A kind of automated testing method and device
WO2015067179A1 (en) Method and apparatus for detecting invalid commodity templates
CN106971757A (en) A kind of method and system of inspection Nand Flash mass
CN114968725A (en) Task dependency relationship correction method and device, computer equipment and storage medium
CN112965853B (en) Data storage and verification method, device and medium of intelligent card
CN102479116A (en) Method and device for viewing code information in system abnormality
CN110928910B (en) Method and device for reading and writing vector elements in Shapfile at high speed
US9342512B1 (en) System and method for repairing data synchronization links
CN115705297A (en) Code call detection method, device, computer equipment and storage medium
CN111651177A (en) Android platform-based number writing method and device and computer readable medium
CN103440289B (en) The incompatible label parallel search of webpage method based on MapReduce

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
CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Sun Feng

Inventor after: Fu Quan

Inventor after: Yu Yuanlan

Inventor before: Sun Feng

Inventor before: Fu Quan

Inventor before: Yu Yuanlan

Inventor before: Yang Chun

CB02 Change of applicant information
CB02 Change of applicant information

Address after: 430000 16-19 / F, building C3, future technology building, 999 Gaoxin Avenue, Donghu New Technology Development Zone, Wuhan, Hubei Province

Applicant after: Wuhan dream database Co., Ltd

Address before: 430000 16-19 / F, building C3, future technology building, 999 Gaoxin Avenue, Donghu New Technology Development Zone, Wuhan, Hubei Province

Applicant before: WUHAN DAMENG DATABASE Co.,Ltd.

CB03 Change of inventor or designer information
CB03 Change of inventor or designer information

Inventor after: Sun Feng

Inventor after: Yu Yuanlan

Inventor before: Sun Feng

Inventor before: Fu Quan

Inventor before: Yu Yuanlan

RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20190125