A document can be retrieved from a primary shard or from any of its replicas, as shown in Figure 10, “하나의 document를 가져온다.”.
Figure 10, “하나의 document를 가져온다.”에서 보듯이, document는 primary나 그것의 모든 replica shard로부터 가져올 수 있다.
Here is the sequence of steps to retrieve a document from either a primary or replica shard:
아래에 primary나 replica shard로부터 document를 가져오는 일련의 과정을 나열하였다..
The client sends a get request to
Node 1.클라이언트가
Node 1에 get request를 보낸다.The node uses the document’s
_idto determine that the document belongs to shard0. Copies of shard0exist on all three nodes. On this occasion, it forwards the request toNode 2.node는 document가 shard
0에 포함되어 있다는 것을 판단하기 위해, document의_id를 사용한다. shard0의 복사본은 3개의 node 모두에 존재한다. 여기에서는, request를Node 2로 전달한다.Node 2returns the document toNode 1, which returns the document to the client.Node 2는Node 1로 document를 반환한다.Node 1은 클라이언트에게 document를 반환한다.
For read requests, the coordinating node will choose a different shard copy on every request in order to balance the load; it round-robins through all shard copies.
읽기 request를 하면, 부하의 분산(shard의 모든 복사본에 대한 round-robins을 통해)을 위해, 모든 request에 대해, coordinating node는 shard의 다른 복사본을 선택할 것이다.
It is possible that, while a document is being indexed, the document will already be present on the primary shard but not yet copied to the replica shards. In this case, a replica might report that the document doesn’t exist, while the primary would have returned the document successfully. Once the indexing request has returned success to the user, the document will be available on the primary and all replica shards.
document가 primary shard에 색인되는 동안, document가 primary shard에는 이미 존재하지만, 아직 replica shard로 아직 복사되지 않았을 가능성도 있다. 이런 경우에, replica는 document가 없다고 할 수도 있다. 반면에 primary shard는 성공적으로 document를 반환한다. 색인 request가 사용자에게 성공했다고 반환되면, document는 primary와 모든 replica shard에서 이용할 수 있다.
'2.X > 1. Getting Started' 카테고리의 다른 글
| 1-04-2. How Primary and Replica Shards Interact (0) | 2017.10.01 |
|---|---|
| 1-04-3. Creating, Indexing, and Deleting a Document (0) | 2017.10.01 |
| 1-04-5. Partial Updates to a Document (0) | 2017.09.30 |
| 1-04-6. Multidocument Patterns (0) | 2017.09.30 |
| 1-05. Searching—The Basic Tools (0) | 2017.09.30 |
