Quick fault-tolerant processing method for data-writing Redis failure

A technology of data writing and processing methods, applied in the field of fault-tolerant processing, which can solve problems such as business data loss and incorrect communication establishment, and achieve the effects of solving data loss, ensuring fluency, and being convenient and simple to use

Inactive Publication Date: 2017-11-07
上海哎媲媲网络技术有限公司
5 Cites 5 Cited by

AI-Extracted Technical Summary

Problems solved by technology

[0003] The purpose of the present invention is to provide a fast fault-tolerant processing method for the failure of data writing into Redis, to solve the problem that durin...
View more

Method used

In the present embodiment, the Redis business of execution failure is added in the fault-tolerant queue to be processed as a fault-tolerant task, and the fault-tolerant tasks in the fault-tolerant queue to be processed are sequentially executed, and will car...
View more

Abstract

The invention discloses a quick fault-tolerant processing method for data-writing Redis failure. The method includes S1, adding a Redis service failed in play as a fault-tolerant task to a fault-tolerant to-be-processed queue; S2, acquiring a fault-tolerant to-be-processed task from the fault-tolerant to-be-processed queue, replaying the Redis service if the fault-tolerant to-be-processed task exists, adding one time in replaying the Redis service, continuously performing the S3, and performing the S4 if the fault-tolerant to-be-processed task does not exist; S3, judging whether replaying of the Redis service in the S2 is successful or not, if yes, storing the Redis service to a Redis server cluster, skipping to the S2 for continuous performance, and if not, adding the Redis service to the fault-tolerant to-be-processed queue and skipping to the S2 for continuous performance; S4, closing the Redis service. The task failed in processing is retried continuously till processed successfully, the problem about data loss caused by interruption of network connection or Redis service is effectively solved, and smoothness in service performance is guaranteed.

Application Domain

Redundant operation error correction

Technology Topic

Data lossNetwork connection

Image

  • Quick fault-tolerant processing method for data-writing Redis failure

Examples

  • Experimental program(4)

Example Embodiment

[0021] Example 1:
[0022] A fast fault-tolerant processing method for failure of data writing to Redis, such as figure 1 As shown, including: business start, execute Redis business, determine whether the Redis business is executed successfully, if the execution is successful, save to the Redis server cluster, if the Redis business execution fails, execute the following steps:
[0023] S1: Add the failed Redis service as a fault-tolerant task to the queue for fault-tolerant processing;
[0024] S2: Obtain the fault-tolerant to-be-processed task from the fault-tolerant to-be-processed queue and determine whether there is a fault-tolerant to-be-processed task. If there is a fault-tolerant to-be-processed task, re-execute the Redis business, and the number of repeated executions of the Redis business is increased by 1 (the Redis business The initial value of the number of repeated executions is 0), continue to execute step S3; if there is no fault-tolerant pending task, execute step S4;
[0025] S3: Determine whether the re-execution of the Redis task in step S2 is successful. If the execution is successful, save it to the Redis server cluster and skip to S2 to continue execution; if the execution fails, add the Redis service to the fault-tolerant pending processing queue again and skip Continue to step S2;
[0026] S4: Close the Redis service.
[0027] Among them, the fault-tolerant tasks are added to the end of the fault-tolerant waiting queue in order, and the processing order of the fault-tolerant tasks is to first process the fault-tolerant task at the head of the fault-tolerant waiting queue. Fault-tolerant processing needs to be processed in strict accordance with the order of business execution, so fault-tolerant tasks must be added to the end of the fault-tolerant waiting queue in order, and the task processing order is to process the first task of the queue first.
[0028] In step S3, if the Redis service fails to be re-executed, the Redis service should be added to the fault-tolerant pending queue again, and should be added to the head of the fault-tolerant pending queue. Fault-tolerant tasks may continue to make mistakes or fail during processing. In order to ensure the orderly execution of the business when rejoining the fault-tolerant pending queue, the fault-tolerant task needs to be placed at the head of the fault-tolerant pending queue so that it can be processed first in the queue In the case of the task at the head of the team, ensure that the business is executed in order to avoid business inversion and error.
[0029] In this embodiment, the failed Redis service is added as a fault-tolerant task to the fault-tolerant to-be-processed queue, the fault-tolerant tasks in the fault-tolerant to-be-processed queue are executed sequentially, and the failed tasks will be retried continuously until the task is successfully executed. . Effectively solve the problem of data loss caused by network connection or Redis service interruption, and ensure the fluency of business execution.

Example Embodiment

[0030] Example 2:
[0031] In order to ensure the order of the added and processed fault-tolerant tasks, on the basis of Embodiment 1, the fault-tolerant pending processing queue is a self-defined synchronization linked list.

Example Embodiment

[0032] Example 3:
[0033] In order to ensure the global unified processing of fault-tolerant tasks, on the basis of Embodiment 1 or Embodiment 2, the fault-tolerant pending processing queue is implemented by using a database.

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.

Similar technology patents

Disposable medical-examination light

ActiveUS20090097236A1good visualizationeasy to use
Owner:UTAH MEDICAL PRODS

Patient positioning support structure

ActiveUS20120198625A1easy to useinexpensive to make
Owner:WARSAW ORTHOPEDIC INC

Classification and recommendation of technical efficacy words

  • Fix data loss
  • easy to use

Memory

PendingCN111324290AFix data lossPrevent power failure
Owner:GIGADEVICE SEMICON (BEIJING) INC +1

Method and system universal for power on and power off of various modules

ActiveCN103246337AFix data lossSave manpower and material costs
Owner:SHENZHEN HONGDIAN TECH CORP

Overheat protection method and apparatus of network communication equipment

InactiveCN102780586AFix data loss
Owner:RUIJIE NETWORKS CO LTD

Laser assisted total joint arthroplasty

InactiveUS20090234360A1easy to use
Owner:ALEXANDER VLADIMIR

Enclosure for a portable hemodialysis system

ActiveUS20090114582A1easy to use
Owner:DEKA PROD LLP
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products