Skip to content

Commit a0c1022

Browse files
denikIsaac
andauthored
acc: re-enable stale-read injection without the engine matrix (redo databricks#6941) (databricks#6969)
Re-applies databricks#6941. databricks#6938 put the `DATABRICKS_BUNDLE_ENGINE=direct` check back into `staleOnceEnabled`: its "leave the stale-read injection fix to databricks#6941" commit was rebased after databricks#6941 merged and reverted it. Nothing sets that variable any more, so the testserver's stale-read injection was off and `postgres_synced_tables/recreate_capped` again recorded a successful recreate instead of the capped-wait failure. This pull request and its description were written by Isaac. Co-authored-by: Isaac <no-reply@databricks.com>
1 parent b3a85b3 commit a0c1022

2 files changed

Lines changed: 8 additions & 10 deletions

File tree

‎acceptance/bundle/resources/postgres_synced_tables/recreate_capped/output.txt‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,16 @@ Resources: 4 created, 0 changed, 0 deleted, 0 unchanged
1111
=== The delete never completes; the capped wait times out and the recreate fails
1212
>>> DATABRICKS_BUNDLE_RESOURCE_MAX_WAIT=1 errcode [CLI] bundle deploy
1313
Uploading bundle files to /Workspace/Users/[USERNAME]/.bundle/recreate-capped-postgres-synced-table-[UNIQUE_NAME]/default/files...
14-
Recreated postgres_synced_tables.my_table
14+
Error: cannot recreate resources.postgres_synced_tables.my_table: waiting after deleting id=synced_tables/lakebase_test_[UNIQUE_NAME].public.trips_synced: timed out: synced table still exists, waiting for deletion to complete
15+
1516
Files: 0 uploaded, 0 deleted
16-
Resources: 1 created, 0 changed, 1 deleted, 3 unchanged
17+
18+
Exit code: 1
1719

1820
>>> [CLI] bundle destroy --auto-approve
1921
The following resources will be deleted:
2022
delete resources.postgres_catalogs.my_catalog
2123
delete resources.postgres_projects.my_project
22-
delete resources.postgres_synced_tables.my_table
2324
delete resources.schemas.pipeline_storage
2425

2526
This action will result in the deletion of the following UC schemas. Any underlying data may be lost:
@@ -31,4 +32,4 @@ all their branches, databases, and endpoints. All data stored in them will be pe
3132

3233
All files and directories at the following location will be deleted: /Workspace/Users/[USERNAME]/.bundle/recreate-capped-postgres-synced-table-[UNIQUE_NAME]/default
3334

34-
Destroy: 4 deleted
35+
Destroy: 3 deleted

‎acceptance/internal/prepare_server.go‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,13 @@ func isTruePtr(value *bool) bool {
6767

6868
// staleOnceEnabled reports whether the testserver should simulate eventual
6969
// consistency (the first GET after a create returns 404). It is opt-in via
70-
// INJECT_STALE_ON_DIRECT=1 and only applies to the direct engine.
70+
// INJECT_STALE_ON_DIRECT=1.
7171
//
7272
// testEnv carries the per-variant EnvMatrix values, which are not visible via
7373
// os/env because matrix variants run in parallel and only reach the CLI subprocess.
7474
func staleOnceEnabled(testEnv []string) bool {
75-
if v, _ := lookupEnv(testEnv, "INJECT_STALE_ON_DIRECT"); v != "1" {
76-
return false
77-
}
78-
engine, _ := lookupEnv(testEnv, "DATABRICKS_BUNDLE_ENGINE")
79-
return engine == "direct"
75+
v, _ := lookupEnv(testEnv, "INJECT_STALE_ON_DIRECT")
76+
return v == "1"
8077
}
8178

8279
func lookupEnv(testEnv []string, key string) (string, bool) {

0 commit comments

Comments
 (0)