Skip to content

Commit bbe6e63

Browse files
committed
Make spaces synchronous in a bank tests
Accidentally option for enabling synchronous mode for spaces in bank tests was not used. It means that with Tarantool cluster we tested asynchronous replication that has lower consistency guarantess that synchronous (eventual consistency). This patch enables is_sync for all spaces used in bank tests. For other tests option "is_sync" was enabled in commit "Make spaces used in tests synchronous" (dfb4d45). Follows up #51
1 parent c41a7fb commit bbe6e63

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ change log follows the conventions of
1919
- Enable :primaries for partition, kill and pause nemeses (#59).
2020
- Fix test bank with accounts in separate tables.
2121
- Mark a singleton instance as a leader manually (#92).
22+
- Enable synchronous mode for spaces in bank tests.
2223

2324
### Changed
2425

src/tarantool/bank.clj

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@
4343
(j/execute! conn [(str "CREATE TABLE IF NOT EXISTS " table-name
4444
"(id INT NOT NULL PRIMARY KEY,
4545
balance INT NOT NULL)")])
46+
(j/execute! conn [(str "SELECT LUA('return box.space."
47+
(clojure.string/upper-case table-name)
48+
":alter{ is_sync = true } or 1')")])
4649
(doseq [a (:accounts test)]
4750
(info "Populating account")
4851
(sql/insert! conn table-name
@@ -103,6 +106,9 @@
103106
"(id INT NOT NULL PRIMARY KEY,"
104107
"account_id INT NOT NULL,"
105108
"balance INT NOT NULL)")])
109+
(j/execute! conn [(str "SELECT LUA('return box.space."
110+
(clojure.string/upper-case (str table-name a))
111+
":alter{ is_sync = true } or 1')")])
106112
(info "Populating account" a)
107113
(sql/insert! conn (str table-name a)
108114
{:id 0
@@ -174,6 +180,9 @@
174180
(j/execute! conn [(str "CREATE TABLE IF NOT EXISTS " table-name
175181
"(id INT NOT NULL PRIMARY KEY,
176182
balance INT NOT NULL)")])
183+
(j/execute! conn [(str "SELECT LUA('return box.space."
184+
(clojure.string/upper-case table-name)
185+
":alter{ is_sync = true } or 1')")])
177186
(doseq [a (:accounts test)]
178187
(info "Populating account")
179188
(sql/insert! conn table-name
@@ -243,6 +252,9 @@
243252
(j/execute! conn [(str "CREATE TABLE IF NOT EXISTS " table-name a
244253
"(id INT NOT NULL PRIMARY KEY,"
245254
"balance INT NOT NULL)")])
255+
(j/execute! conn [(str "SELECT LUA('return box.space."
256+
(clojure.string/upper-case (str table-name a))
257+
":alter{ is_sync = true } or 1')")])
246258
(info "Populating account" a)
247259
(sql/insert! conn (str table-name a)
248260
{:id 0

0 commit comments

Comments
 (0)