-
Notifications
You must be signed in to change notification settings - Fork 360
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix SeekGE in DDB #6561
Fix SeekGE in DDB #6561
Conversation
pkg/kv/dynamodb/main_test.go
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Think we can just remove this file and move the code left to the test entry function.
No need global kvparams and etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
pkg/kv/postgres/main_test.go
Outdated
@@ -49,7 +48,7 @@ func runDBInstance(dockerPool *dockertest.Pool) (string, func()) { | |||
// create connection | |||
var pgPool *pgxpool.Pool | |||
port := resource.GetPort("5432/tcp") | |||
uri := fmt.Sprintf("postgres://lakefs:lakefs@localhost:%s/lakefs_db?sslmode=disable", port) | |||
uri := fmt.Sprintf("postgres://lakefs:lakefs@localhost:%s/%s?sslmode=disable", port, dbName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wrap dbName with call to url.PathEscape
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to keep the same database name and have each test create a different db or scheme on the same instance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Co-authored-by: Barak Amar <[email protected]>
|
||
// create a new schema per test | ||
schemaName := "test_schema" + testutil.UniqueName() | ||
_, err = conn.Exec(context.Background(), fmt.Sprintf("CREATE SCHEMA IF NOT EXISTS %s;", schemaName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use connection's QuoteIdentifier
to quote the schemaName
value.
Check the following if it works:
_, err = conn.Exec(context.Background(), fmt.Sprintf("CREATE SCHEMA IF NOT EXISTS %s;", schemaName)) | |
_, err = conn.Exec(ctx, "CREATE SCHEMA IF NOT EXISTS " + conn. QuoteIdentifier(schemaName)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't. I simply escaped it
pkg/kv/postgres/store_test.go
Outdated
schemaName := "test_schema" + testutil.UniqueName() | ||
_, err = conn.Exec(context.Background(), fmt.Sprintf("CREATE SCHEMA IF NOT EXISTS %s;", schemaName)) | ||
if err != nil { | ||
t.Fatalf("Error creating schema: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
t.Fatalf("Error creating schema: %v", err) | |
t.Fatalf("Error creating schema '%s': %s", schemaName, err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
pkg/kv/postgres/store_test.go
Outdated
|
||
store, err := kv.Open(ctx, kvparams.Config{ | ||
Type: postgres.DriverName, | ||
Postgres: &kvparams.Postgres{ConnectionString: databaseURI, ScanPageSize: 10}, | ||
Postgres: &kvparams.Postgres{ConnectionString: fmt.Sprintf("%s&search_path=%s", databaseURI, schemaName), ScanPageSize: kvtest.MaxPageSize}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to url parse the connection string to add qs parameter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM left some minor comments
…keFS into 6558-import-ddb-bug
closes #6558