pgbelt 0.5.4__py3-none-any.whl → 0.6.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- pgbelt/cmd/teardown.py +4 -5
- pgbelt/config/remote.py +3 -1
- pgbelt/util/pglogical.py +11 -16
- pgbelt/util/postgres.py +0 -1
- {pgbelt-0.5.4.dist-info → pgbelt-0.6.1.dist-info}/METADATA +2 -1
- {pgbelt-0.5.4.dist-info → pgbelt-0.6.1.dist-info}/RECORD +9 -9
- {pgbelt-0.5.4.dist-info → pgbelt-0.6.1.dist-info}/WHEEL +1 -1
- {pgbelt-0.5.4.dist-info → pgbelt-0.6.1.dist-info}/LICENSE +0 -0
- {pgbelt-0.5.4.dist-info → pgbelt-0.6.1.dist-info}/entry_points.txt +0 -0
pgbelt/cmd/teardown.py
CHANGED
|
@@ -79,15 +79,14 @@ async def teardown(
|
|
|
79
79
|
teardown_node(src_root_pool, "pg1", src_logger),
|
|
80
80
|
teardown_node(dst_root_pool, "pg2", dst_logger),
|
|
81
81
|
)
|
|
82
|
+
await gather(
|
|
83
|
+
revoke_pgl(src_root_pool, conf.tables, src_logger),
|
|
84
|
+
revoke_pgl(dst_root_pool, conf.tables, dst_logger),
|
|
85
|
+
)
|
|
82
86
|
|
|
83
87
|
if full:
|
|
84
88
|
await sleep(15)
|
|
85
89
|
|
|
86
|
-
await gather(
|
|
87
|
-
revoke_pgl(src_root_pool, conf.tables, src_logger),
|
|
88
|
-
revoke_pgl(dst_root_pool, conf.tables, dst_logger),
|
|
89
|
-
)
|
|
90
|
-
|
|
91
90
|
await gather(
|
|
92
91
|
teardown_pgl(src_root_pool, src_logger),
|
|
93
92
|
teardown_pgl(dst_root_pool, dst_logger),
|
pgbelt/config/remote.py
CHANGED
|
@@ -154,7 +154,9 @@ async def resolve_remote_config(
|
|
|
154
154
|
)
|
|
155
155
|
return None
|
|
156
156
|
except RemoteConfigError as e:
|
|
157
|
-
logger.error(
|
|
157
|
+
logger.error(
|
|
158
|
+
f"Failed to resolve remote configuration for {db} {dc}. RemoteConfigError {e}"
|
|
159
|
+
)
|
|
158
160
|
return None
|
|
159
161
|
except ValidationError:
|
|
160
162
|
logger.error(
|
pgbelt/util/pglogical.py
CHANGED
|
@@ -209,20 +209,15 @@ async def teardown_replication_set(pool: Pool, logger: Logger) -> None:
|
|
|
209
209
|
|
|
210
210
|
async def revoke_pgl(pool: Pool, tables: list[str], logger: Logger) -> None:
|
|
211
211
|
"""
|
|
212
|
-
Revoke data access permissions from pglogical
|
|
212
|
+
Revoke data access permissions from pglogical, and drop the pglogical role
|
|
213
213
|
"""
|
|
214
214
|
logger.info("Revoking data access permissions from pglogical...")
|
|
215
215
|
async with pool.acquire() as conn:
|
|
216
216
|
async with conn.transaction():
|
|
217
217
|
try:
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
)
|
|
222
|
-
else:
|
|
223
|
-
await conn.execute(
|
|
224
|
-
"REVOKE ALL ON ALL TABLES IN SCHEMA public FROM pglogical;"
|
|
225
|
-
)
|
|
218
|
+
await conn.execute(
|
|
219
|
+
"REVOKE ALL ON ALL TABLES IN SCHEMA public FROM pglogical;"
|
|
220
|
+
)
|
|
226
221
|
await conn.execute(
|
|
227
222
|
"REVOKE ALL ON ALL SEQUENCES IN SCHEMA public FROM pglogical;"
|
|
228
223
|
)
|
|
@@ -233,10 +228,16 @@ async def revoke_pgl(pool: Pool, tables: list[str], logger: Logger) -> None:
|
|
|
233
228
|
else:
|
|
234
229
|
raise e
|
|
235
230
|
|
|
231
|
+
logger.info("Dropping pglogical role...")
|
|
232
|
+
async with pool.acquire() as conn:
|
|
233
|
+
async with conn.transaction():
|
|
234
|
+
await conn.execute("DROP ROLE IF EXISTS pglogical;")
|
|
235
|
+
logger.debug("Pglogical role dropped")
|
|
236
|
+
|
|
236
237
|
|
|
237
238
|
async def teardown_pgl(pool: Pool, logger: Logger) -> None:
|
|
238
239
|
"""
|
|
239
|
-
If they exist, drop the pglogical extension
|
|
240
|
+
If they exist, drop the pglogical extension
|
|
240
241
|
"""
|
|
241
242
|
logger.info("Dropping pglogical extension...")
|
|
242
243
|
async with pool.acquire() as conn:
|
|
@@ -244,12 +245,6 @@ async def teardown_pgl(pool: Pool, logger: Logger) -> None:
|
|
|
244
245
|
await conn.execute("DROP EXTENSION IF EXISTS pglogical;")
|
|
245
246
|
logger.debug("Pglogical extension dropped")
|
|
246
247
|
|
|
247
|
-
logger.info("Dropping pglogical user...")
|
|
248
|
-
async with pool.acquire() as conn:
|
|
249
|
-
async with conn.transaction():
|
|
250
|
-
await conn.execute("DROP ROLE IF EXISTS pglogical;")
|
|
251
|
-
logger.debug("Pglogical user dropped")
|
|
252
|
-
|
|
253
248
|
|
|
254
249
|
async def subscription_status(pool: Pool, logger: Logger) -> str:
|
|
255
250
|
"""
|
pgbelt/util/postgres.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pgbelt
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.6.1
|
|
4
4
|
Summary: A CLI tool used to manage Postgres data migrations from beginning to end, for a single database or a fleet, leveraging pglogical replication.
|
|
5
5
|
Author: Varjitt Jeeva
|
|
6
6
|
Author-email: varjitt.jeeva@autodesk.com
|
|
@@ -9,6 +9,7 @@ Classifier: Programming Language :: Python :: 3
|
|
|
9
9
|
Classifier: Programming Language :: Python :: 3.9
|
|
10
10
|
Classifier: Programming Language :: Python :: 3.10
|
|
11
11
|
Classifier: Programming Language :: Python :: 3.11
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
12
13
|
Requires-Dist: aiofiles (>=0.8,<23.3)
|
|
13
14
|
Requires-Dist: asyncpg (>=0.27,<0.30)
|
|
14
15
|
Requires-Dist: pydantic (>=2.0,<3.0)
|
|
@@ -8,20 +8,20 @@ pgbelt/cmd/schema.py,sha256=XAAj2BH6HVoA1LxuWw2kheesGDu41L3GAd5UahNp3nE,4760
|
|
|
8
8
|
pgbelt/cmd/setup.py,sha256=v-phLiNQYFportKHvcG0EBfarfv_F2xekeL9P_wuI5c,5252
|
|
9
9
|
pgbelt/cmd/status.py,sha256=r-Zv5QiO7oQQBTewnTXOdl-IslNGE6lAxlgArAYRTWU,3190
|
|
10
10
|
pgbelt/cmd/sync.py,sha256=-ffZOCTWcFXjcpRe7MFfBRdV8tjSh6uoVALvykX85pU,8375
|
|
11
|
-
pgbelt/cmd/teardown.py,sha256=
|
|
11
|
+
pgbelt/cmd/teardown.py,sha256=Yps1iejx9amW2b3kmtKjw5-ySrk_qK3LfaH6EOM7NHE,3490
|
|
12
12
|
pgbelt/config/__init__.py,sha256=SXok1aZcpMYJpX_hk5cuKO33CJ5s8IESkswNN9KsVSo,35
|
|
13
13
|
pgbelt/config/config.py,sha256=Kw2H-G1Evfj0TXIbh3k06gE72dZEp_wXWJ2Icq_T54c,3817
|
|
14
14
|
pgbelt/config/models.py,sha256=XrTZLps-jQvOaOdf9BWV5cx6xqHFRD7TnxtQMpohR1c,5432
|
|
15
|
-
pgbelt/config/remote.py,sha256=
|
|
15
|
+
pgbelt/config/remote.py,sha256=RQ_dfL5g2ChVP6jeGWnpQMVKQZK1o2m9-ZPYBMaaGj4,5297
|
|
16
16
|
pgbelt/main.py,sha256=YiagBiGt8pbNlukkRxROXnQX1Tx6ax7c6riuHRCrPYU,186
|
|
17
17
|
pgbelt/util/__init__.py,sha256=-6KkvVMz-yGNQfeoo4CZZrgWKXYmFd4CMyoiao8OnFE,40
|
|
18
18
|
pgbelt/util/asyncfuncs.py,sha256=7i_GpBmUNNZ8RUGvU-q5nclsoaCm6Lx8jLP8usYvmZc,583
|
|
19
19
|
pgbelt/util/dump.py,sha256=p6M26s3FXnSCTmee4v7X0-azYvmcVz6DkZf8J8YxU0s,14357
|
|
20
20
|
pgbelt/util/logs.py,sha256=l2jT-WKZ-33eNDw4S4W1_eE4ISo4rtDRXYLVf4QTV4Y,1699
|
|
21
|
-
pgbelt/util/pglogical.py,sha256=
|
|
22
|
-
pgbelt/util/postgres.py,sha256=
|
|
23
|
-
pgbelt-0.
|
|
24
|
-
pgbelt-0.
|
|
25
|
-
pgbelt-0.
|
|
26
|
-
pgbelt-0.
|
|
27
|
-
pgbelt-0.
|
|
21
|
+
pgbelt/util/pglogical.py,sha256=JwIKI9pP8WDLa_32-2jnQuzyGC4oSeFYo0iP7ljAJvI,12620
|
|
22
|
+
pgbelt/util/postgres.py,sha256=9AgnmHdYpWVypyBNTEQEpd4COoa1JEQXoELOR8-HrzQ,13668
|
|
23
|
+
pgbelt-0.6.1.dist-info/LICENSE,sha256=FQ5cFkW02dKK3LmKH8z-rwn93tWSCh7lsxfNUiWcFsg,10758
|
|
24
|
+
pgbelt-0.6.1.dist-info/METADATA,sha256=sRQAbecXNJwIUJJDjNu762VtktWR90HIQNmMBMokPag,2826
|
|
25
|
+
pgbelt-0.6.1.dist-info/WHEEL,sha256=FMvqSimYX_P7y0a7UY-_Mc83r5zkBZsCYPm7Lr0Bsq4,88
|
|
26
|
+
pgbelt-0.6.1.dist-info/entry_points.txt,sha256=SCz_poPjkaVnWpJ-CeytAnDzbVc6l0WalOwitIqW_3g,40
|
|
27
|
+
pgbelt-0.6.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|