mirror of
https://github.com/elastic/kibana.git
synced 2025-06-28 03:01:21 -04:00
[LockManager] Add scenarios to Lock manager readme
This commit is contained in:
parent
2ed4e8a341
commit
bb966812b3
1 changed files with 9 additions and 1 deletions
|
@ -3,6 +3,14 @@
|
|||
A simple, distributed lock manager built on top of Elasticsearch.
|
||||
Ensures that only one process at a time can hold a named lock, with automatic lease renewal and token fencing for safe release.
|
||||
|
||||
### Typical scenarios
|
||||
|
||||
**Re-indexing**
|
||||
Starting multiple re-index operation on the same source simultaniously can lead to data corruption. Wrapping the re-index call in `withLock("my_reindex")` guarantees that only one consumer can start the operation.
|
||||
|
||||
**Bootstrapping tasks**
|
||||
On Kibana startup you might need to run migrations, create/update index mappings or bootstrapping other types of assets. Without a lock, every Kibana node that boots in parallel will try to run the same migrations. A lock ensures that the startup migrations only runs exactly once, even if multiple Kibana nodes spin up concurrently.
|
||||
|
||||
# API Documentation
|
||||
|
||||
## `withLock<T>(lockId, callback, options)`
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue