From 03dfc8cbd0989c5b5257cfc51f16617086be1164 Mon Sep 17 00:00:00 2001
From: Yaroslav Dynnikov <yaroslav.dynnikov@gmail.com>
Date: Mon, 3 Jul 2023 11:50:48 +0300
Subject: [PATCH] doc: fix Lua help

---
 src/luamod.rs | 22 ++++++++++++----------
 1 file changed, 12 insertions(+), 10 deletions(-)

diff --git a/src/luamod.rs b/src/luamod.rs
index be467db19f..9cd5d67766 100644
--- a/src/luamod.rs
+++ b/src/luamod.rs
@@ -578,17 +578,17 @@ pub(crate) fn setup(args: &args::Run) {
 
             received MsgTimeoutNow from 3 and starts an election
                 to get leadership., from: 3, term: 4, raft_id: 3
-            
+
             starting a new election, term: 4, raft_id: 3
-            
+
             became candidate at term 5, term: 5, raft_id: 3
-            
+
             broadcasting vote request, to: [4, 1], log_index: 54,
                 log_term: 4, term: 5, type: MsgRequestVote, raft_id: 3
-            
-            received votes response, term: 5, type: MsgRequestVoteResponse, 
+
+            received votes response, term: 5, type: MsgRequestVoteResponse,
                 approvals: 2, rejections: 0, from: 4, vote: true, raft_id: 3
-        
+
             became leader at term 5, term: 5, raft_id: 3
         "},
         tlua::function0(|| -> traft::Result<()> {
@@ -941,10 +941,9 @@ pub(crate) fn setup(args: &args::Run) {
             -- Delete the second Peppa friend, specifying index and term
             -- explicitly. It's necessary when there are some yielding
             -- operations between reading and writing.
-            index, term = {
+            index, term =
                 assert(pico.raft_get_index()),
-                assert(pico.raft_status()).term,
-            }
+                assert(pico.raft_status()).term
             emily = box.space.friends_of_peppa.index.name:get('Emily')
             fiber.sleep(1) -- do something yielding
 
@@ -1080,9 +1079,12 @@ pub(crate) fn setup(args: &args::Run) {
             pico.cas({
                 kind = 'insert',
                 space = 'friends_of_peppa',
-                key = {1, 'Suzy'},
+                tuple = {1, 'Suzy'},
             })
 
+            -- Global spaces are read with Tarantool `box` API for now.
+            box.space.friends_of_peppa:fselect()
+
             -- Creates an implicitly sharded space 'wonderland' with two fields:
             -- property (string) and value (any).
             pico.create_space({
-- 
GitLab