Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the Riak request process and there are several failure scenarios for Riak

2025-03-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

What is the Riak request process and Riak has several failure scenarios, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

The CAP principle tells us that consistency, availability, and partition tolerance can only focus on two of them at most. In NoSQL systems, partition tolerance (P) has almost become a must. So many NoSQL choose to sacrifice a certain degree of consistency. The following editor will explain what is the Riak request process? how many failure scenarios does Riak have?

What is the Riak request process?

First of all, this paper introduces the request processing process of Riak, which is stored in N copies of redundant data. Each time R copies are read, W copies are required for write operations.

The N nodes where the requested key is located are calculated.

Initiate requests to these N nodes in turn

Wait for W (if write) or R (if read) of these N nodes to return success

Return the corresponding data to the client.

There are several failure scenarios for Riak

1. One of the nodes failed before reading the data

The data was successfully written into three copies in Word3.

One of the nodes failed

Read three more copies of the data with Renew3 and initiate three requests

Not_found was returned for this read operation.

This time, when the system detects only two copies of data, it will activate the repair machine to back up one copy of the data to the secondary node to ensure that there are three backups.

Subsequent reads will read two copies from primary and one from secondary, in order to successfully read three copies of data.

two。 Two of the nodes failed before reading the data

The data was successfully written into three copies in Word3.

Two of the nodes failed.

Read three more copies of the data with Renew3 and initiate three requests

Not_found was returned for this read operation.

Subsequent reads will read one copy from primary and two pieces of data from secondary, in order to successfully read three pieces of data.

3. All the first three nodes failed to read the data

The data was successfully written into three copies in Word3.

Three of the nodes failed

The data read operation will return not_found forever until a node recovers

4. A node failure before the write operation

A node failure

Data initiates three write requests with Word3

A secondary node takes on one of the write requests

The following read request will read three pieces of data normally.

5. A node failed before the write operation, and then it was restored

A node failure

Data initiates three write requests with Word3

A secondary node takes on one of the write requests

The failure node is restored again.

Within 60 seconds, a process called hintedhandoff starts to migrate the data from secondary to the newly restored primary

After the hintedhandoff process is completed, the data returns to normal

6. Read and write during hintedhandoff

In the hintedhandoff process, because the original primary node is started, data read and write operations will be performed on this node, which may cause this node to return not_found temporarily because some values have not been backed up yet.

7. Read and write operations during the recovery period after the failure of two primary nodes

At this time, the newly restored node will go through the hintedhandoff process, and the read and write operation will still start the repair machine to back up the data to the secordary due to the occurrence of not_found.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report