Commit e96c786
committed
[docdb] yb-master fails to restart after errors during first run (yugabyte#5276)
Summary:
Before we depended on the `is_first_run` flag (which is set upon creation of the instance file) in order to determine how we would initialize the system catalog metadata. Since this flag is not very trustworthy if there are errors between instance file creation and sys catalog init, this revision removes this dependency - Instead we now will do a load or create of the sys catalog metadata.
Also removing temporary fix from yugabyte#4866.
Test Plan:
Test examples from the github issue:
```
# Creation of instance file succeeds but sys catalog creation fails
yb-master --fs_data_dirs=/tmp/testcrash1 --rpc_bind_addresses=127.0.0.1:7100 --master_addresses=127.0.0.2:7100 --replication_factor=1
# Should succeed now:
yb-master --fs_data_dirs=/tmp/testcrash1 --rpc_bind_addresses=127.0.0.1:7100 --master_addresses=127.0.0.1:7100 --replication_factor=1
```
---
Also testing example from issue yugabyte#4866:
```
rm -rf /tmp/foo1
mkdir -p /tmp/foo1
python3 -m http.server 7100 --bind 127.0.0.1 &
yb-master --fs_data_dirs=/tmp/foo1 --rpc_bind_addresses=127.0.0.1:7100 --master_addresses=127.0.0.1:7100 --replication_factor=1
kill %1
yb-master --fs_data_dirs=/tmp/foo1 --rpc_bind_addresses=127.0.0.1:7100 --master_addresses=127.0.0.1:7100 --replication_factor=1
# Still works
```
---
Also adding `ybd --cxx-test master-test --gtest_filter MasterTest.TestNetworkErrorOnFirstRun`
Reviewers: sanketh, bogdan, rahuldesirazu
Reviewed By: rahuldesirazu
Subscribers: ybase
Differential Revision: https://phabricator.dev.yugabyte.com/D92401 parent d916f3b commit e96c786
File tree
6 files changed
+39
-20
lines changed- src/yb
- master
- server
6 files changed
+39
-20
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
561 | 561 | | |
562 | 562 | | |
563 | 563 | | |
564 | | - | |
| 564 | + | |
565 | 565 | | |
566 | 566 | | |
567 | 567 | | |
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
| 578 | + | |
579 | 579 | | |
580 | 580 | | |
581 | 581 | | |
| |||
1289 | 1289 | | |
1290 | 1290 | | |
1291 | 1291 | | |
1292 | | - | |
| 1292 | + | |
1293 | 1293 | | |
1294 | | - | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
| 1298 | + | |
| 1299 | + | |
| 1300 | + | |
| 1301 | + | |
1295 | 1302 | | |
1296 | 1303 | | |
1297 | 1304 | | |
| |||
1300 | 1307 | | |
1301 | 1308 | | |
1302 | 1309 | | |
1303 | | - | |
1304 | | - | |
| 1310 | + | |
| 1311 | + | |
1305 | 1312 | | |
1306 | | - | |
| 1313 | + | |
| 1314 | + | |
1307 | 1315 | | |
1308 | 1316 | | |
1309 | 1317 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
170 | 170 | | |
171 | 171 | | |
172 | 172 | | |
173 | | - | |
| 173 | + | |
174 | 174 | | |
175 | 175 | | |
176 | 176 | | |
| |||
826 | 826 | | |
827 | 827 | | |
828 | 828 | | |
829 | | - | |
| 829 | + | |
830 | 830 | | |
831 | 831 | | |
832 | 832 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
1804 | 1805 | | |
1805 | 1806 | | |
1806 | 1807 | | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
1807 | 1820 | | |
1808 | 1821 | | |
1809 | 1822 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
| 276 | + | |
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
67 | 67 | | |
68 | 68 | | |
69 | 69 | | |
| 70 | + | |
70 | 71 | | |
71 | 72 | | |
72 | 73 | | |
| |||
98 | 99 | | |
99 | 100 | | |
100 | 101 | | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
101 | 105 | | |
102 | 106 | | |
103 | 107 | | |
| |||
157 | 161 | | |
158 | 162 | | |
159 | 163 | | |
160 | | - | |
161 | 164 | | |
162 | 165 | | |
163 | 166 | | |
| |||
461 | 464 | | |
462 | 465 | | |
463 | 466 | | |
464 | | - | |
465 | 467 | | |
466 | 468 | | |
467 | 469 | | |
468 | 470 | | |
469 | 471 | | |
470 | 472 | | |
471 | | - | |
472 | | - | |
473 | | - | |
474 | | - | |
475 | | - | |
476 | | - | |
| 473 | + | |
| 474 | + | |
477 | 475 | | |
478 | | - | |
| 476 | + | |
| 477 | + | |
479 | 478 | | |
480 | 479 | | |
481 | 480 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | 133 | | |
135 | 134 | | |
136 | 135 | | |
| |||
0 commit comments