Skip to content

Commit 0f62c1e

Browse files
Satbekvakhov
authored andcommitted
[TNTP-931] Fix vshard.router.bootstrap example in README
The example with vshard.router.bootstrap polling has been removed. Instead, the following call is now used: vshard.router.bootstrap({timeout = TIMEOUT, if_not_bootstrapped = true}). This approach aligns with the vshard documentation vshard.router.bootstrap and prevents the error: \['UNKNOWN_BUCKETS', '15000 buckets are not discovered'\]. (cherry picked from commit 8c1813eaf9bb26aa371b1034ecc586a70cd722fd)
1 parent f8d36c0 commit 0f62c1e

File tree

1 file changed

+3
-19
lines changed

1 file changed

+3
-19
lines changed

README.md

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2034,28 +2034,12 @@ issues.
20342034

20352035
```lua
20362036
-- myrouter.lua
2037-
2038-
local clock = require('clock')
2039-
local fiber = require('fiber')
20402037
local log = require('log')
2041-
20422038
local vshard = require('vshard')
20432039

2044-
local TIMEOUT = 60
2045-
local DELAY = 0.1
2046-
2047-
local start = clock.monotonic()
2048-
while clock.monotonic() - start < TIMEOUT do
2049-
local ok, err = vshard.router.bootstrap({
2050-
if_not_bootstrapped = true,
2051-
})
2052-
2053-
if ok then
2054-
break
2055-
end
2056-
2057-
log.info(('Router bootstrap error: %s'):format(err))
2058-
fiber.sleep(DELAY)
2040+
local ok, err = vshard.router.bootstrap({timeout = 15})
2041+
if not ok then
2042+
log.info(('Router bootstrap error: %s'):format(err))
20592043
end
20602044
```
20612045

0 commit comments

Comments
 (0)