Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added snapshotless observing squad in the integrators section #749

Merged
merged 5 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 68 additions & 0 deletions docs/integrators/snapshotless-observing-squad.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
id: snapshotless-observing-squad
title: Snapshotless Observing Squad
---

[comment]: # (mx-abstract)

This page describes the Snapshotless Observing Squad, a type of Observing Squad optimized for real-time requests such as accounts data fetching and vm-query operations.

ovidiuolteanu marked this conversation as resolved.
Show resolved Hide resolved
[comment]: # (mx-context-auto)

## Overview

Whenever a node is executing the trie snapshotting process, the accounts data fetching & vm-query operations are greatly affected.
andreibancioiu marked this conversation as resolved.
Show resolved Hide resolved
This is caused by the fact that the snapshotting operation consumes a large number of CPU cycles along with disk iops.
andreibancioiu marked this conversation as resolved.
Show resolved Hide resolved
raduchis marked this conversation as resolved.
Show resolved Hide resolved
The nodes started with the flag `--operation-mode snapshotless-observer` will not create trie snapshots on every epoch and will
also prune the trie storage in order to save space.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's an unnecessary newline above (markdown renderer will ignore it, anyway).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed cessary new-lines

raduchis marked this conversation as resolved.
Show resolved Hide resolved

## Setup

### Creating a snapshotless observing squad from scratch

If you choose to install a snapshotless observing squad from 0, you should follow the instruction from the
andreibancioiu marked this conversation as resolved.
Show resolved Hide resolved
raduchis marked this conversation as resolved.
Show resolved Hide resolved
[observing squad section](/integrators/observing-squad) and, when you will start configuring the `variables.cfg` file,
raduchis marked this conversation as resolved.
Show resolved Hide resolved
remember to add the operation mode in the node's extra flags definition:
```
NODE_EXTRA_FLAGS="-log-save -operation-mode snapshotless-observer"
```

After that, wou can resume following the normal observer squad installation steps.
raduchis marked this conversation as resolved.
Show resolved Hide resolved

### Converting a normal observing squad to a snapshotless observing squad

If you already have an observing squad, and you want to transform it into a snapshotless observing squad, the
easiest way is to manually edit the service file `/etc/systemd/system/elrond-node-x.service` (with `sudo`) and
append the `-operation-mode snapshotless-observer` flag at the end of the `ExecStart=` line.
In the end, the file should look like:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure, perhaps the editor splits the lines? When writing markdown, I usually only use newlines when changing paragraphs (just an opinion).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed cessary new-lines

```
[Unit]
Description=MultiversX Node-0
After=network-online.target

[Service]
User=jls
WorkingDirectory=/home/ubuntu/elrond-nodes/node-0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps, at some point, the installation scripts should create a symlink (mvx-nodes)?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will fix that with @valentin-lup in the future

ExecStart=/home/ubuntu/elrond-nodes/node-0/node -use-log-view -log-logger-name -log-correlation -log-level *:DEBUG -rest-api-interface :8080 -log-save -profile-mode -operation-mode snapshotless-observer
StandardOutput=journal
StandardError=journal
Restart=always
RestartSec=3
LimitNOFILE=4096

[Install]
WantedBy=multi-user.target
```

Save the file, and force a reload units with the command
raduchis marked this conversation as resolved.
Show resolved Hide resolved
```bash
sudo systemctl daemon-reload
```

After units reload, you can stop the nodes and start them.
andreibancioiu marked this conversation as resolved.
Show resolved Hide resolved
raduchis marked this conversation as resolved.
Show resolved Hide resolved

:::caution
Even if the nodes are synced, after changing the operation mode, they will start re-sync their state in
raduchis marked this conversation as resolved.
Show resolved Hide resolved
"snapshotless" format.
:::

ovidiuolteanu marked this conversation as resolved.
Show resolved Hide resolved
1 change: 1 addition & 0 deletions sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,7 @@ const sidebars = {
items: [
"integrators/observing-squad",
"integrators/deep-history-squad",
"integrators/snapshotless-observing-squad",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would put the snapshotless-observing-squad page above the deep-history-squad.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed. More use-cases, more integrators that require snapshotless squads - as opposed to deep-history squads (more exotic, less used).

],
},
{
Expand Down
Loading