File: rpl_timestamps_line_topology.inc

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (114 lines) | stat: -rw-r--r-- 3,479 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
# The test file is invoked from rpl.rpl_timestamps_line_topology and
# group_replication.gr_replicaton_timestamps
#
# This file has two main sections:
#   1) Retrieve the OCT and ICT from each server
#   2) Verify that the timestamps are correct
#
# param $gtid - the gtid of the transaction to be checked


--echo # 1. Save both timestamps (original/immediate) on all servers.

# Switch to server_1, save both OCT and ICT.
--let $rpl_connection_name= $server_1
--source include/rpl_connection.inc

--source include/get_original_commit_timestamp.inc
--let $server_1_OCT= $original_commit_timestamp

--source include/get_immediate_commit_timestamp.inc
--let $server_1_ICT= $immediate_commit_timestamp

# Switch to server_2, save both OCT and ICT.
--let $rpl_connection_name= $server_2
--source include/rpl_connection.inc

--source include/get_original_commit_timestamp.inc
--let $server_2_OCT= $original_commit_timestamp

--source include/get_immediate_commit_timestamp.inc
--let $server_2_ICT= $immediate_commit_timestamp

# Switch to server_3, save both OCT and ICT.
--let $rpl_connection_name= $server_3
--source include/rpl_connection.inc

--source include/get_original_commit_timestamp.inc
--let $server_3_OCT= $original_commit_timestamp

--source include/get_immediate_commit_timestamp.inc
--let $server_3_ICT= $immediate_commit_timestamp

--echo # 2. Verify that the timestamps are correct.

--let $assert_text= Assert that the OCT is the same on $server_1 and $server_2.
--let $assert_cond= $server_1_OCT = $server_2_OCT
--source include/assert.inc

--let $assert_text= Assert that the OCT is the same on $server_2 and $server_3.
--let $assert_cond= $server_2_OCT = $server_3_OCT
--source include/assert.inc

--let $assert_text= Assert that OCT is the same as ICT on $server_1
--let $assert_cond= $server_1_OCT = $server_1_ICT
--source include/assert.inc

# Check if the platform is windows to select the appropriate assert condition
--let $is_windows= 0
if (`SELECT CONVERT(@@VERSION_COMPILE_OS USING latin1) IN ('Win32', 'Win64', 'Windows')`)
{
  --let $is_windows= 1
}

--let $assert_text= Assert that ICT > OCT on $server_2.
if ($is_windows)
{
  # Due to windows lower resolution timestamps, it may happen that $server_2_ICT
  # is equal to $server_2_OCT
  --let $assert_cond= $server_2_ICT >= $server_2_OCT
}
if (!$is_windows)
{
  --let $assert_cond= $server_2_ICT > $server_2_OCT
}
--source include/assert.inc

--let $assert_text= Assert that ICT > OCT on $server_3.
if ($is_windows)
{
  # Due to windows lower resolution timestamps, it may happen that $server_2_ICT
  # is equal to $server_3_OCT
  --let $assert_cond= $server_3_ICT >= $server_3_OCT
}
if (!$is_windows)
{
  --let $assert_cond= $server_3_ICT > $server_3_OCT
}
--source include/assert.inc

--let $assert_text= Assert that ICT on server_1 < ICT on $server_2.
if ($is_windows)
{
  # Due to windows lower resolution timestamps, it may happen that $server_1_ICT
  # is equal to $server_2_ICT
  --let $assert_cond= $server_1_ICT <= $server_2_ICT
}
if (!$is_windows)
{
  --let $assert_cond= $server_1_ICT < $server_2_ICT
}
--source include/assert.inc

--let $assert_text= Assert that ICT on server_2 < ICT on $server_3.
if ($is_windows)
{
  # Due to windows lower resolution timestamps, it may happen that $server_2_ICT
  # is equal to $server_3_ICT
  --let $assert_cond= $server_2_ICT <= $server_3_ICT
}
if (!$is_windows)
{
  --let $assert_cond= $server_2_ICT < $server_3_ICT
}
--source include/assert.inc