vldpyatkov commented on code in PR #1493:
URL: https://github.com/apache/ignite-3/pull/1493#discussion_r1067423291


##########
modules/metastorage/README.md:
##########
@@ -0,0 +1,45 @@
+# Metastorage
+
+The module for storing and accessing metadata. This module is linked to 
another one:
+
+- metastorage-api - The module contains classes that other components can use 
to access the metastorage service.
+
+To avoid data loss, the storage is distributed using the RAFT consensus 
algorithm. Every cluster node has access to such distributed
+storage, but the majority of members are learners, and only a small number are 
voters in terms of RAFT algorithm. Typically, only a small
+number of the cluster's voting nodes make up the raft-group (number of nodes 
must be odd, either 3 or 5.). The remaining nodes listen to
+metadata updates but do not vote (they called learners in terms of RAFT).
+
+## Threading model
+
+There is only one thread specifically for notifying watchers. The thread is 
created in KeyValueStorage from the executor:
+
+```java
+private ExecutorService watchExecutor = Executors.newSingleThreadExecutor(new 
NamedThreadFactory(NamedThreadFactory
+        .threadPrefix(nodeName, "metastorage-watch-executor"),LOG));
+```
+
+Additionally, the storage internally has two thread executors for creating a 
snapshot:
+
+```java
+private ExecutorService snapshotExecutor = Executors.newFixedThreadPool(2,new 
NamedThreadFactory(NamedThreadFactory
+        .threadPrefix(nodeName, "metastorage-snapshot-executor"),LOG));
+```
+
+To distinguish to which node the specific thread belongs, each executor has a 
node name in its prefix.
+
+### Interface methods
+
+Futures are returned by a number of Metastorage Manager operations, like 
get(), getAll(), invoke(), etc. Those futures are completed when
+the corresponding RAFT command is completed in the Metastorage group. Although 
the entire replication process took place in the RAFT
+threads, this result appears in the RAFT client executor with prefix 
<NODE_NAME>%Raft-Group-Client. See RAFT module for more information
+about its threading model.
+
+Although some methods return futures, they are often run synchronously. 
Futures are dependent on asynchronous Metastorage initialization,

Review Comment:
   Honestly, I do not shut what exactly methods can appear in Metastorage 
manager, except method that are using to access data (but they are, for 
example, method of stopping watch). Rather, I mean this about all method that 
does not connected with data access, but return a future.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to