CN107329858A - A kind of Quick fault-tolerance processing method of data write-in Redis failures - Google Patents
A kind of Quick fault-tolerance processing method of data write-in Redis failures Download PDFInfo
- Publication number
- CN107329858A CN107329858A CN201710557197.2A CN201710557197A CN107329858A CN 107329858 A CN107329858 A CN 107329858A CN 201710557197 A CN201710557197 A CN 201710557197A CN 107329858 A CN107329858 A CN 107329858A
- Authority
- CN
- China
- Prior art keywords
- fault
- redis
- tolerant
- business
- task
- 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/1479—Generic software techniques for error detection or fault masking
- G06F11/1489—Generic software techniques for error detection or fault masking through recovery blocks
Abstract
The invention discloses a kind of Quick fault-tolerance processing method of data write-in Redis failures, including:S1:The Redis business for performing failure is added in fault-tolerant pending queue as fault-tolerant task;S2:Calm treat unfairly in processing queue obtains fault-tolerant waiting task, if there is fault-tolerant waiting task, re-executes Redis business, and the number of times that the Redis business is repeated plus 1, continues executing with S3 steps;If in the absence of fault-tolerant waiting task, performing S4 steps;S3:Judge to re-execute whether Redis tasks succeed in S2 steps, if running succeeded, be saved in Redis server clusters, jump to S2 and continue executing with;If performing failure, the Redis business is again added in fault-tolerant pending queue, and jumps to S2 steps and is continued executing with;S4:Close Redis services.The present invention will be retried uninterruptedly for the task of processing failure, until tasks carrying success, efficiently solve the data loss problem caused by network connection or Redis service disruptions, it is ensured that the fluency that business is performed.
Description
Technical field
The present invention relates to fault-tolerance processing method, and in particular to a kind of Quick fault-tolerance processing side of data write-in Redis failures
Method.
Background technology
Redis is to use most common data cached storage system now, and the storage system cache phase such as Memcached
Than Redis not only supports the deployment way such as publish/subscribe, principal and subordinate;Also support more data types, and every kind of data type
Both provide abundant operational order.Redis middlewares provide unified interface for other operation systems and access service.Principal and subordinate and the whistle
The server that the integrated service management of soldierization can increase under disaster is fault-tolerant, but because the offer of service is carried out by network,
So in use probably due to causing communication correctly to set up the reason for network signal or Redis itself, now, just
It will be lost in the business datum of execution.
The content of the invention
It is an object of the invention to provide a kind of Quick fault-tolerance processing method of data write-in Redis failures, solve
Probably due to causing communication correctly to set up the reason for network signal or Redis itself, during Redis service uses
The problem of business datum of execution will lose.
To solve above-mentioned technical problem, the present invention uses following technical scheme:
A kind of Quick fault-tolerance processing method of data write-in Redis failures, comprises the following steps:
S1:The Redis business for performing failure is added in fault-tolerant pending queue as fault-tolerant task;
S2:Calm treat unfairly obtains fault-tolerant waiting task in processing queue and judges whether fault-tolerant waiting task, if depositing
In fault-tolerant waiting task, then Redis business is re-executed, and the number of times that the Redis business is repeated plus 1, continues to hold
Row S3 steps;If in the absence of fault-tolerant waiting task, performing S4 steps;
S3:Judge to re-execute whether Redis tasks succeed in S2 steps, if running succeeded, be saved in Redis server sets
Group, jumps to S2 and continues executing with;If performing failure, the Redis business is again added in fault-tolerant pending queue, and is jumped to
S2 steps are continued executing with;
S4:Close Redis services.
Further scheme is that fault-tolerant task adds the end of fault-tolerant pending queue in sequence, fault-tolerant task
Processing sequence is the fault-tolerant task for first handling fault-tolerant pending queue head end.Fault-tolerant processing need to be entered in strict accordance with business execution sequence
Row processing, so fault-tolerant task will sequentially add the tail end of fault-tolerant pending queue in order, the processing sequence of task is first to locate
Manage head of the queue task.
Further scheme is, in S3 steps, adds the Redis business again if re-executing Redis service fails
The head end of fault-tolerant pending queue should be added to by being added in fault-tolerant pending queue.Fault-tolerant task is in processing procedure, Ke Nengji
Continuous error or failure, when rejoining fault-tolerant pending queue, in order to ensure that the order of business is performed, it is necessary to by fault-tolerant task
The head end of fault-tolerant pending queue is put into, so can be in the case where queue first handles head of the queue task, it is ensured that work flow
Perform, it is to avoid business is reverse and malfunctions.
Further scheme is that fault-tolerant pending queue is customized synchronous chained list.Fault-tolerant pending queue is certainly
The synchronous chained list of definition, it can be ensured that add and the fault-tolerant task of processing is orderly.
Further scheme is that fault-tolerant pending queue uses database realizing.Fault-tolerant pending queue is extended to
Database realizing, so as to ensure the fault-tolerant unitized processing of the task overall situation.
Further scheme is, to the above-mentioned fault-tolerant maximum number of times repeated of task configuration, if time repeated
Number has exceeded the number of times that configured maximum is repeated, then the Redis business is saved in database and makees persistence processing.
During fault-tolerant processing, due to network connection or Redis service disruptions, Redis business re-executes possible one
Failure directly is performed, in order to ensure the fluency of business, Redis business can be saved in database and make persistence processing, treated
Network recovery, user re-executes again as needed, therefore can configure the continuation number of retries of pending fault-tolerant task, more than secondary
During number, write-in Mysql does persistence processing.(Failure is such as write, more detailed logging need to be recorded).
Further scheme is that Redis business is saved in after database and is actually needed determination Redis weights according to user
The time newly performed.
Compared with prior art, the beneficial effects of the invention are as follows:
The present invention provides consistent framework support, user by carrying out the method for business processing to needing to use Redis
Just it is simple.
The present invention will be retried uninterruptedly for the task of processing failure, until tasks carrying success.Efficiently solve
Data loss problem caused by network connection or Redis service disruptions, it is ensured that the fluency that business is performed.
Brief description of the drawings
Fig. 1 is flow chart of the invention.
Embodiment
In order to make the purpose , technical scheme and advantage of the present invention be clearer, it is right below in conjunction with drawings and Examples
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:
A kind of Quick fault-tolerance processing method of data write-in Redis failures, as shown in figure 1, including:Business starts, and performs Redis
Business, judges whether Redis business runs succeeded, if running succeeded, is saved in Redis server clusters, if Redis business
Failure is performed, then performs the following steps:
S1:The Redis business for performing failure is added in fault-tolerant pending queue as fault-tolerant task;
S2:Calm treat unfairly obtains fault-tolerant waiting task in processing queue and judges whether fault-tolerant waiting task, if depositing
In fault-tolerant waiting task, then Redis business is re-executed, and the number of times that the Redis business is repeated plus 1(Wherein should
The initial value for the number of times that Redis business is repeated is 0), continue executing with S3 steps;If in the absence of fault-tolerant waiting task, holding
Row S4 steps;
S3:Judge to re-execute whether Redis tasks succeed in S2 steps, if running succeeded, be saved in Redis server sets
Group, jumps to S2 and continues executing with;If performing failure, the Redis business is again added in fault-tolerant pending queue, and is jumped to
S2 steps are continued executing with;
S4:Close Redis services.
Wherein, fault-tolerant task adds the end of fault-tolerant pending queue in sequence, and the processing sequence of fault-tolerant task is first
Handle the fault-tolerant task of fault-tolerant pending queue head end.Fault-tolerant processing need to be handled in strict accordance with business execution sequence, so
Fault-tolerant task will sequentially add the tail end of fault-tolerant pending queue in order, and the processing sequence of task is first processing head of the queue task.
In S3 steps, if re-execute Redis service fails is again added to fault-tolerant pending queue by the Redis business
In should be added to the head end of fault-tolerant pending queue.Fault-tolerant task may continue to malfunction or failure, again in processing procedure
When adding fault-tolerant pending queue, in order to ensure that the order of business is performed, it is necessary to which fault-tolerant task is put into fault-tolerant pending queue
Head end, so can be in the case where queue first handles head of the queue task, it is ensured that work flow is performed, it is to avoid business it is reverse and
Error.
The Redis business for performing failure is added in fault-tolerant pending queue as fault-tolerant task in the present embodiment, will
Fault-tolerant task order in fault-tolerant pending queue is performed, and will uninterruptedly be retried for the task of processing failure, until
Tasks carrying success.Efficiently solve the data loss problem caused by network connection or Redis service disruptions, it is ensured that industry
The fluency that business is performed.
Embodiment 2:
In order to ensure the fault-tolerant task for adding and handling is orderly, on the basis of embodiment 1, fault-tolerant pending queue is self-defined
Synchronous chained list.
Embodiment 3:
In order to ensure the fault-tolerant unitized processing of the task overall situation, on the basis of embodiment 1 or embodiment 2, fault-tolerant pending queue
Using database realizing.
Embodiment 4:
On the basis of embodiment 3, to the above-mentioned fault-tolerant maximum number of times repeated of task configuration, if the number of times repeated is
The Redis business, then be saved in database and make persistence processing by the number of times repeated more than the maximum configured.Will
Redis business is saved in the time for being actually needed after database according to user and determining that Redis is re-executed.
The present embodiment is during fault-tolerant processing, due to network connection or Redis service disruptions, Redis industry
Business, which is re-executed, may perform failure always, and in order to ensure the fluency of business, Redis business can be saved in database
Make persistence processing, treat network recovery, user re-executes again as needed, therefore can configure the continuation of pending fault-tolerant task
Number of retries, during more than number of times, write-in Mysql does persistence processing.(Failure is such as write, more detailed logging need to be recorded).
Although reference be made herein to invention has been described for multiple explanatory embodiments of the invention, however, it is to be understood that
Those skilled in the art can be designed that a lot of other modification and embodiment, and these modifications and embodiment will fall in this Shen
Please be within disclosed spirit and spirit.More specifically, can in the range of disclosure, drawings and claims
A variety of variations and modifications are carried out with the building block to theme composite configuration and/or layout.Except to building block and/or layout
Outside the modification and improvement of progress, to those skilled in the art, other purposes also will be apparent.
Claims (7)
1. a kind of Quick fault-tolerance processing method of data write-in Redis failures, it is characterised in that comprise the following steps:
S1:The Redis business for performing failure is added in fault-tolerant pending queue as fault-tolerant task;
S2:Calm treat unfairly in processing queue obtains fault-tolerant waiting task, if there is fault-tolerant waiting task, re-executes
Redis business, and the number of times that the Redis business is repeated plus 1, continues executing with S3 steps;If in the absence of fault-tolerant pending
Task, performs S4 steps;
S3:Judge to re-execute whether Redis tasks succeed in S2 steps, if running succeeded, be saved in Redis server sets
Group, jumps to S2 and continues executing with;If performing failure, the Redis business is again added in fault-tolerant pending queue, and is jumped to
S2 steps are continued executing with;
S4:Close Redis services.
2. the Quick fault-tolerance processing method of data write-in Redis failures according to claim 1, it is characterised in that:It is described
Fault-tolerant task adds the end of fault-tolerant pending queue in sequence, and the processing sequence of fault-tolerant task is first to handle fault-tolerant pending
The fault-tolerant task of queue head end.
3. the Quick fault-tolerance processing method of data write-in Redis failures according to claim 2, it is characterised in that:It is described
In S3 steps, the Redis business is again added in fault-tolerant pending queue and should be added if re-executing Redis service fails
To the head end of fault-tolerant pending queue.
4. the Quick fault-tolerance processing method of data write-in Redis failures according to claim 1, it is characterised in that:It is described
Fault-tolerant pending queue is customized synchronous chained list.
5. the Quick fault-tolerance processing method of data write-in Redis failures according to claim 1, it is characterised in that:It is described
Fault-tolerant pending queue uses database realizing.
6. the Quick fault-tolerance processing method of data write-in Redis failures according to claim 1, it is characterised in that:To institute
The fault-tolerant maximum number of times repeated of task configuration is stated, if the number of times repeated has exceeded what configured maximum was repeated
The Redis business, then be saved in database and make persistence processing by number of times.
7. the Quick fault-tolerance processing method of data write-in Redis failures according to claim 6, it is characterised in that:Will
Redis business is saved in the time for being actually needed after database according to user and determining that Redis is re-executed.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710557197.2A CN107329858A (en) | 2017-07-10 | 2017-07-10 | A kind of Quick fault-tolerance processing method of data write-in Redis failures |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710557197.2A CN107329858A (en) | 2017-07-10 | 2017-07-10 | A kind of Quick fault-tolerance processing method of data write-in Redis failures |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107329858A true CN107329858A (en) | 2017-11-07 |
Family
ID=60197379
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710557197.2A Pending CN107329858A (en) | 2017-07-10 | 2017-07-10 | A kind of Quick fault-tolerance processing method of data write-in Redis failures |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107329858A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109002373A (en) * | 2018-07-24 | 2018-12-14 | 阿里巴巴集团控股有限公司 | Database connects abnormality eliminating method and device |
CN110471774A (en) * | 2019-06-28 | 2019-11-19 | 苏宁云计算有限公司 | A kind of data processing method and device based on unified task schedule |
CN111026584A (en) * | 2019-12-23 | 2020-04-17 | 重庆紫光华山智安科技有限公司 | Device, method and equipment for solving key value database file damage |
CN111212151A (en) * | 2020-04-22 | 2020-05-29 | 武汉中科通达高新技术股份有限公司 | File transmission method, device and storage medium |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101127950A (en) * | 2007-09-04 | 2008-02-20 | 中兴通讯股份有限公司 | A SMS retry processing method, device and its applied SMS center |
CN103886079A (en) * | 2014-03-26 | 2014-06-25 | 北京京东尚科信息技术有限公司 | Data processing method and system |
CN105471714A (en) * | 2015-12-09 | 2016-04-06 | 百度在线网络技术(北京)有限公司 | Message processing method and device |
CN106407021A (en) * | 2016-07-01 | 2017-02-15 | 厦门易名科技股份有限公司 | Queue-based business request processing method |
US20170104636A1 (en) * | 2015-10-08 | 2017-04-13 | Opsclarity, Inc. | Systems and methods of constructing a network topology |
-
2017
- 2017-07-10 CN CN201710557197.2A patent/CN107329858A/en active Pending
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101127950A (en) * | 2007-09-04 | 2008-02-20 | 中兴通讯股份有限公司 | A SMS retry processing method, device and its applied SMS center |
CN103886079A (en) * | 2014-03-26 | 2014-06-25 | 北京京东尚科信息技术有限公司 | Data processing method and system |
US20170104636A1 (en) * | 2015-10-08 | 2017-04-13 | Opsclarity, Inc. | Systems and methods of constructing a network topology |
CN105471714A (en) * | 2015-12-09 | 2016-04-06 | 百度在线网络技术(北京)有限公司 | Message processing method and device |
CN106407021A (en) * | 2016-07-01 | 2017-02-15 | 厦门易名科技股份有限公司 | Queue-based business request processing method |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109002373A (en) * | 2018-07-24 | 2018-12-14 | 阿里巴巴集团控股有限公司 | Database connects abnormality eliminating method and device |
CN110471774A (en) * | 2019-06-28 | 2019-11-19 | 苏宁云计算有限公司 | A kind of data processing method and device based on unified task schedule |
CN111026584A (en) * | 2019-12-23 | 2020-04-17 | 重庆紫光华山智安科技有限公司 | Device, method and equipment for solving key value database file damage |
CN111212151A (en) * | 2020-04-22 | 2020-05-29 | 武汉中科通达高新技术股份有限公司 | File transmission method, device and storage medium |
CN111212151B (en) * | 2020-04-22 | 2020-07-07 | 武汉中科通达高新技术股份有限公司 | File transmission method, device and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11258725B2 (en) | Distributed stream-based database triggers | |
US8799906B2 (en) | Processing a batched unit of work | |
US6886064B2 (en) | Computer system serialization control method involving unlocking global lock of one partition, after completion of machine check analysis regardless of state of other partition locks | |
CN107329858A (en) | A kind of Quick fault-tolerance processing method of data write-in Redis failures | |
JP5102901B2 (en) | Method and system for maintaining data integrity between multiple data servers across a data center | |
US8549536B2 (en) | Performing a workflow having a set of dependancy-related predefined activities on a plurality of task servers | |
US10289443B2 (en) | System and method for sharing global transaction identifier (GTRID) in a transactional middleware environment | |
US8898520B1 (en) | Method of assessing restart approach to minimize recovery time | |
US20160140164A1 (en) | Complex event processing apparatus and complex event processing method | |
US7856639B2 (en) | Monitoring and controlling applications executing in a computing node | |
US10083098B1 (en) | Network function virtualization (NFV) virtual network function (VNF) crash recovery | |
CN104601668B (en) | Data push method, device and system based on condition managing | |
JP6288275B2 (en) | Virtualization infrastructure management apparatus, virtualization infrastructure management system, virtualization infrastructure management method, and virtualization infrastructure management program | |
US20140289562A1 (en) | Controlling method, information processing apparatus, storage medium, and method of detecting failure | |
US8595192B1 (en) | Systems and methods for providing high availability to instance-bound databases | |
CN104111867B (en) | A kind of virtual machine (vm) migration device and method | |
US9195528B1 (en) | Systems and methods for managing failover clusters | |
US20130110782A1 (en) | Oportunistic database duplex operations | |
US10812586B2 (en) | Method and system for high availability topology for master-slave data systems with low write traffic | |
CN113760522A (en) | Task processing method and device | |
CN102196016B (en) | Controlling execution of services across servers | |
CN114860505A (en) | Object storage data asynchronous backup method and system | |
CN103488505A (en) | Patching method, device and system | |
US8671307B2 (en) | Task relay system, apparatus, and recording medium | |
KR20120075622A (en) | Method, system and compueter readable medium to store log data effective in the game service |
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: 20171107 |
|
RJ01 | Rejection of invention patent application after publication |