fix: Add indexer backup lock to fit the deployment model (#4531)

* Pass db to init_index

* Prepare sqlx

* Update ee repo ref
This commit is contained in:
wendrul
2024-10-16 14:36:12 +02:00
committed by GitHub
parent 99c5b3ecda
commit 411bce7e13
8 changed files with 57 additions and 3 deletions
@@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "INSERT INTO concurrency_locks (id, last_locked_at, owner)\n VALUES ($1, now(), $2)\n ON CONFLICT (id)\n DO UPDATE SET\n last_locked_at = now(),\n owner = $2",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Varchar",
"Varchar"
]
},
"nullable": []
},
"hash": "14abf759dae7ba5c38017ba6001927c6df0653a02b87bcea939066e39ebcf24d"
}
@@ -0,0 +1,15 @@
{
"db_name": "PostgreSQL",
"query": "UPDATE concurrency_locks SET\n last_locked_at = now()\n WHERE id = $1 AND owner = $2",
"describe": {
"columns": [],
"parameters": {
"Left": [
"Text",
"Text"
]
},
"nullable": []
},
"hash": "57e270e032e8c04dda7b5c1ca949861756b3ad367a4a500728332a7cb91560a4"
}
@@ -5,7 +5,7 @@
"columns": [
{
"ordinal": 0,
"name": "?column?",
"name": "bool",
"type_info": "Bool"
}
],
@@ -0,0 +1,22 @@
{
"db_name": "PostgreSQL",
"query": "SELECT last_locked_at\n FROM concurrency_locks\n WHERE id = $1\n FOR UPDATE",
"describe": {
"columns": [
{
"ordinal": 0,
"name": "last_locked_at",
"type_info": "Timestamp"
}
],
"parameters": {
"Left": [
"Text"
]
},
"nullable": [
false
]
},
"hash": "cecf1addc4aecb087a14786b2a9165895ca61ef042947c7314f66514d7f29edc"
}
+1
View File
@@ -10580,6 +10580,7 @@ dependencies = [
"bytes",
"chrono",
"futures",
"lazy_static",
"object_store",
"serde",
"serde_json",
+1 -1
View File
@@ -1 +1 @@
eb79a4e23a2d133a3a964065b354f569e98f1224
f120cf90c1795f8254418c227c74b043c8b07185
+1 -1
View File
@@ -476,7 +476,7 @@ Windmill Community Edition {GIT_VERSION}
#[cfg(feature = "tantivy")]
let (index_reader, index_writer) = if should_index_jobs {
let (r, w) = windmill_indexer::indexer_ee::init_index().await?;
let (r, w) = windmill_indexer::indexer_ee::init_index(&db).await?;
(Some(r), Some(w))
} else {
(None, None)
+1
View File
@@ -29,3 +29,4 @@ tempfile.workspace = true
bytes.workspace = true
object_store = { workspace = true, optional = true}
tokio-tar.workspace = true
lazy_static.workspace = true