mirror of
https://github.com/google/nomulus.git
synced 2025-08-02 07:52:11 +02:00
Combine the two Lock classes into one class (#1126)
* Combine the two Lock classes into one class This allows us to remove the DAO and to just treat locks the same as we would treat any other object -- generically grabbing them from the transaction manager. We do not need to be concerned about the changeover between Datastore and SQL because we assume that any such changeover will require sufficient downtime that any currently-valid acquired locks will expire during the downtime. Otherwise, we could get into a situation where an action has acquired a particular lock in Datastore but not SQL.
This commit is contained in:
parent
5b56e8b71b
commit
0d67ea3a6e
22 changed files with 170 additions and 579 deletions
|
@ -261,11 +261,11 @@ td.section {
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="property_name">generated on</td>
|
||||
<td class="property_value">2021-04-21 21:56:39.575987</td>
|
||||
<td class="property_value">2021-05-07 18:02:12.304005</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="property_name">last flyway file</td>
|
||||
<td id="lastFlywayFile" class="property_value">V93__defer_all_fkeys.sql</td>
|
||||
<td id="lastFlywayFile" class="property_value">V94__rename_lock_scope.sql</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -284,7 +284,7 @@ td.section {
|
|||
generated on
|
||||
</text>
|
||||
<text text-anchor="start" x="4027.94" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
2021-04-21 21:56:39.575987
|
||||
2021-05-07 18:02:12.304005
|
||||
</text>
|
||||
<polygon fill="none" stroke="#888888" points="3940.44,-4 3940.44,-44 4205.44,-44 4205.44,-4 3940.44,-4" /> <!-- allocationtoken_a08ccbef -->
|
||||
<g id="node1" class="node">
|
||||
|
@ -2535,7 +2535,7 @@ td.section {
|
|||
text not null
|
||||
</text>
|
||||
<text text-anchor="start" x="3957.5" y="-1541.48" font-family="Helvetica,sans-Serif" font-weight="bold" font-style="italic" font-size="14.00">
|
||||
tld
|
||||
"scope"
|
||||
</text>
|
||||
<text text-anchor="start" x="4062.5" y="-1540.48" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
</text>
|
||||
|
@ -5415,7 +5415,7 @@ td.section {
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"></td>
|
||||
<td class="minwidth"><b><i>tld</i></b></td>
|
||||
<td class="minwidth"><b><i>"scope"</i></b></td>
|
||||
<td class="minwidth">text not null</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -5438,7 +5438,7 @@ td.section {
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"></td>
|
||||
<td class="minwidth">tld</td>
|
||||
<td class="minwidth">"scope"</td>
|
||||
<td class="minwidth"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
|
@ -261,11 +261,11 @@ td.section {
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="property_name">generated on</td>
|
||||
<td class="property_value">2021-04-21 21:56:37.513728</td>
|
||||
<td class="property_value">2021-05-07 18:02:10.32026</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="property_name">last flyway file</td>
|
||||
<td id="lastFlywayFile" class="property_value">V93__defer_all_fkeys.sql</td>
|
||||
<td id="lastFlywayFile" class="property_value">V94__rename_lock_scope.sql</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
|
@ -274,19 +274,19 @@ td.section {
|
|||
<svg viewbox="0.00 0.00 4850.02 4900.91" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" id="erDiagram" style="overflow: hidden; width: 100%; height: 800px"> <g id="graph0" class="graph" transform="scale(1 1) rotate(0) translate(4 4896.91)">
|
||||
<title>SchemaCrawler_Diagram</title>
|
||||
<polygon fill="white" stroke="transparent" points="-4,4 -4,-4896.91 4846.02,-4896.91 4846.02,4 -4,4" />
|
||||
<text text-anchor="start" x="4573.52" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
<text text-anchor="start" x="4581.52" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
generated by
|
||||
</text>
|
||||
<text text-anchor="start" x="4656.52" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
<text text-anchor="start" x="4664.52" y="-29.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
SchemaCrawler 16.10.1
|
||||
</text>
|
||||
<text text-anchor="start" x="4572.52" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
<text text-anchor="start" x="4580.52" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
generated on
|
||||
</text>
|
||||
<text text-anchor="start" x="4656.52" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
2021-04-21 21:56:37.513728
|
||||
<text text-anchor="start" x="4664.52" y="-10.8" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
2021-05-07 18:02:10.32026
|
||||
</text>
|
||||
<polygon fill="none" stroke="#888888" points="4569.02,-4 4569.02,-44 4834.02,-44 4834.02,-4 4569.02,-4" /> <!-- allocationtoken_a08ccbef -->
|
||||
<polygon fill="none" stroke="#888888" points="4577.02,-4 4577.02,-44 4834.02,-44 4834.02,-4 4577.02,-4" /> <!-- allocationtoken_a08ccbef -->
|
||||
<g id="node1" class="node">
|
||||
<title>allocationtoken_a08ccbef</title>
|
||||
<polygon fill="#ebcef2" stroke="transparent" points="3001.5,-2741.91 3001.5,-2760.91 3200.5,-2760.91 3200.5,-2741.91 3001.5,-2741.91" />
|
||||
|
@ -5655,7 +5655,7 @@ td.section {
|
|||
text not null
|
||||
</text>
|
||||
<text text-anchor="start" x="4535.5" y="-3401.71" font-family="Helvetica,sans-Serif" font-weight="bold" font-style="italic" font-size="14.00">
|
||||
tld
|
||||
"scope"
|
||||
</text>
|
||||
<text text-anchor="start" x="4640.5" y="-3400.71" font-family="Helvetica,sans-Serif" font-size="14.00">
|
||||
</text>
|
||||
|
@ -11297,7 +11297,7 @@ td.section {
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"></td>
|
||||
<td class="minwidth"><b><i>tld</i></b></td>
|
||||
<td class="minwidth"><b><i>"scope"</i></b></td>
|
||||
<td class="minwidth">text not null</td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -11335,7 +11335,7 @@ td.section {
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"></td>
|
||||
<td class="minwidth">tld</td>
|
||||
<td class="minwidth">"scope"</td>
|
||||
<td class="minwidth"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
|
@ -11358,7 +11358,7 @@ td.section {
|
|||
</tr>
|
||||
<tr>
|
||||
<td class="spacer"></td>
|
||||
<td class="minwidth">tld</td>
|
||||
<td class="minwidth">"scope"</td>
|
||||
<td class="minwidth">ascending</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
|
|
@ -91,3 +91,4 @@ V90__update_timestamp.sql
|
|||
V91__defer_fkeys.sql
|
||||
V92__singletons.sql
|
||||
V93__defer_all_fkeys.sql
|
||||
V94__rename_lock_scope.sql
|
||||
|
|
15
db/src/main/resources/sql/flyway/V94__rename_lock_scope.sql
Normal file
15
db/src/main/resources/sql/flyway/V94__rename_lock_scope.sql
Normal file
|
@ -0,0 +1,15 @@
|
|||
-- Copyright 2021 The Nomulus Authors. All Rights Reserved.
|
||||
--
|
||||
-- Licensed under the Apache License, Version 2.0 (the "License");
|
||||
-- you may not use this file except in compliance with the License.
|
||||
-- You may obtain a copy of the License at
|
||||
--
|
||||
-- http://www.apache.org/licenses/LICENSE-2.0
|
||||
--
|
||||
-- Unless required by applicable law or agreed to in writing, software
|
||||
-- distributed under the License is distributed on an "AS IS" BASIS,
|
||||
-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
-- See the License for the specific language governing permissions and
|
||||
-- limitations under the License.
|
||||
|
||||
ALTER TABLE IF EXISTS "Lock" RENAME tld TO scope;
|
|
@ -501,11 +501,11 @@
|
|||
|
||||
create table "Lock" (
|
||||
resource_name text not null,
|
||||
tld text not null,
|
||||
scope text not null,
|
||||
acquired_time timestamptz not null,
|
||||
expiration_time timestamptz not null,
|
||||
request_log_id text not null,
|
||||
primary key (resource_name, tld)
|
||||
primary key (resource_name, scope)
|
||||
);
|
||||
|
||||
create table "PollMessage" (
|
||||
|
|
|
@ -653,7 +653,7 @@ CREATE TABLE public."KmsSecret" (
|
|||
|
||||
CREATE TABLE public."Lock" (
|
||||
resource_name text NOT NULL,
|
||||
tld text NOT NULL,
|
||||
scope text NOT NULL,
|
||||
acquired_time timestamp with time zone NOT NULL,
|
||||
expiration_time timestamp with time zone NOT NULL,
|
||||
request_log_id text NOT NULL
|
||||
|
@ -1303,7 +1303,7 @@ ALTER TABLE ONLY public."KmsSecret"
|
|||
--
|
||||
|
||||
ALTER TABLE ONLY public."Lock"
|
||||
ADD CONSTRAINT "Lock_pkey" PRIMARY KEY (resource_name, tld);
|
||||
ADD CONSTRAINT "Lock_pkey" PRIMARY KEY (resource_name, scope);
|
||||
|
||||
|
||||
--
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue