From a2a8080a9eb89ac5a40edf5c9e5590fc20d1d6df Mon Sep 17 00:00:00 2001 From: Omar Abdulaziz Date: Sat, 31 Aug 2024 17:11:52 +0300 Subject: [PATCH 1/2] lock cache row to prevent concurrent updates --- grid-proxy/internal/explorer/db/setup.sql | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/grid-proxy/internal/explorer/db/setup.sql b/grid-proxy/internal/explorer/db/setup.sql index d349ef3e..7f54733b 100644 --- a/grid-proxy/internal/explorer/db/setup.sql +++ b/grid-proxy/internal/explorer/db/setup.sql @@ -408,6 +408,12 @@ $$ BEGIN IF (TG_OP = 'UPDATE' AND NEW.state = 'Deleted') THEN BEGIN + -- lock cache row to prevent concurrent updates + PERFORM 1 + FROM resources_cache + WHERE node_id = NEW.node_id + FOR UPDATE; + UPDATE resources_cache SET used_cru = resources_cache.used_cru - contract_resources.cru, @@ -621,7 +627,7 @@ BEGIN total_ips = total_ips + ( CASE - WHEN TG_OP = 'INSERT' + WHEN TG_OP = 'INSERT' THEN 1 WHEn TG_OP = 'DELETE' THEN -1 From 603a57a53db1cd3987f0c7b09dfeb31f732a8866 Mon Sep 17 00:00:00 2001 From: Omar Abdulaziz Date: Sun, 1 Sep 2024 10:45:26 +0300 Subject: [PATCH 2/2] update chart and changelog --- grid-proxy/CHANGELOG.md | 10 +++++++--- grid-proxy/charts/gridproxy/Chart.yaml | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/grid-proxy/CHANGELOG.md b/grid-proxy/CHANGELOG.md index 2867ad09..b4f0c34e 100644 --- a/grid-proxy/CHANGELOG.md +++ b/grid-proxy/CHANGELOG.md @@ -6,11 +6,15 @@ Check `/version` on any instance to know the version. ### 3.13 ---- +## Releases -- include releases from v0.13.5 to v0.14.11 +### v0.15.12 -## Releases +--- + +- `fix` serialization_failure due to concurrent update +- `feat` include gpu cards in the node response +- `feat` use proper level logging ### v0.15.11 diff --git a/grid-proxy/charts/gridproxy/Chart.yaml b/grid-proxy/charts/gridproxy/Chart.yaml index 7724c0d4..07fa8f3b 100644 --- a/grid-proxy/charts/gridproxy/Chart.yaml +++ b/grid-proxy/charts/gridproxy/Chart.yaml @@ -20,6 +20,6 @@ version: 1.0.0 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to # follow Semantic Versioning. They should reflect the version the application is using. -appVersion: 0.15.11 +appVersion: 0.15.12 # make sure to update the changelog with the changes in this release