Skip to content
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

read operations fix #45

Merged
merged 1 commit into from
Aug 22, 2024
Merged

read operations fix #45

merged 1 commit into from
Aug 22, 2024

Conversation

qrort
Copy link
Collaborator

@qrort qrort commented Aug 22, 2024

No description provided.

@qrort qrort force-pushed the ydbcp-ik8s-dev branch 2 times, most recently from e302e13 to 4e1f81e Compare August 22, 2024 11:32
Copy link

📝 Test results

ydbcp

28 tests (28 passed)
%%{init: {"theme":"base","themeVariables":{"fontFamily":"monospace","pieSectionTextSize":"24px","darkMode":true,"pie1":"#2da44e"}}}%%
pie showData
"Passed" : 28

Loading
📦 Package🟢 Passed🔴 Failed🟡 Skipped⏳ Duration
🟡 ydbcp/cmd/ydbcp0000ms
🧪 Tests(none)
🖨️ Output
(none)
🟡 ydbcp/internal/auth0000ms
🧪 Tests(none)
🖨️ Output
(none)
🟡 ydbcp/internal/config0000ms
🧪 Tests(none)
🖨️ Output
(none)
🟡 ydbcp/internal/connectors/client0000ms
🧪 Tests(none)
🖨️ Output
(none)
🟡 ydbcp/internal/connectors/db00010ms
🧪 Tests(none)
🖨️ Output
(none)
🟢 ydbcp/internal/connectors/db/yql/queries4001016.9999999999999ms
🧪 Tests
  • 🟢TestQueryBuilder_CreateCreate
  • 🟢TestQueryBuilder_Read
  • 🟢TestQueryBuilder_UpdateCreate
  • 🟢TestQueryBuilder_UpdateUpdate
🖨️ Output
=== RUN   TestQueryBuilder_Read
2024-08-22T11:35:14.857Z	DEBUG	queries/read.go:135	read query	{"yql": "SELECT column1, column2, column3 FROM table1 WHERE (column1 = $param0 OR column1 = $param1) AND (column2 = $param2 OR column2 = $param3)"}
--- PASS: TestQueryBuilder_Read (0.00s)
=== RUN   TestQueryBuilder_UpdateUpdate
2024-08-22T11:35:14.858Z	DEBUG	queries/write.go:270	write query	{"yql": "UPDATE Backups SET status = $status_0 WHERE id = $id_0;\nUPDATE Operations SET status = $status_1, message = $message_1 WHERE id = $id_1"}
--- PASS: TestQueryBuilder_UpdateUpdate (0.00s)
=== RUN   TestQueryBuilder_CreateCreate
2024-08-22T11:35:14.858Z	DEBUG	queries/write.go:270	write query	{"yql": "UPSERT INTO Backups (id, container_id, database, endpoint, initiated, s3_endpoint, s3_region, s3_bucket, s3_path_prefix, status, message) VALUES ($id_0, $container_id_0, $database_0, $endpoint_0, $initiated_0, $s3_endpoint_0, $s3_region_0, $s3_bucket_0, $s3_path_prefix_0, $status_0, $message_0);\nUPSERT INTO Operations (id, type, status, initiated, created_at, container_id, database, endpoint, backup_id, operation_id, message) VALUES ($id_1, $type_1, $status_1, $initiated_1, $created_at_1, $container_id_1, $database_1, $endpoint_1, $backup_id_1, $operation_id_1, $message_1)"}
--- PASS: TestQueryBuilder_CreateCreate (0.00s)
=== RUN   TestQueryBuilder_UpdateCreate
2024-08-22T11:35:14.859Z	DEBUG	queries/write.go:270	write query	{"yql": "UPDATE Backups SET status = $status_0 WHERE id = $id_0;\nUPSERT INTO Operations (id, type, status, initiated, created_at, container_id, database, endpoint, backup_id, operation_id, message, paths, paths_to_exclude) VALUES ($id_1, $type_1, $status_1, $initiated_1, $created_at_1, $container_id_1, $database_1, $endpoint_1, $backup_id_1, $operation_id_1, $message_1, $paths_1, $paths_to_exclude_1)"}
--- PASS: TestQueryBuilder_UpdateCreate (0.00s)
🟢 ydbcp/internal/handlers20001030ms
🧪 Tests
  • 🟢TestRBOperationHandlerCancellingOperationCancelled
  • 🟢TestRBOperationHandlerCancellingOperationCompletedSuccessfully
  • 🟢TestRBOperationHandlerCancellingOperationInProgress
  • 🟢TestRBOperationHandlerDeadlineExceededForCancellingOperation
  • 🟢TestRBOperationHandlerDeadlineExceededForPendingOperation
  • 🟢TestRBOperationHandlerInvalidOperationResponse
  • 🟢TestRBOperationHandlerPendingOperationCancelled
  • 🟢TestRBOperationHandlerPendingOperationCompletedSuccessfully
  • 🟢TestRBOperationHandlerPendingOperationInProgress
  • 🟢TestRBOperationHandlerRetriableErrorForPendingOperation
  • 🟢TestTBOperationHandlerCancellingOperationCancelled
  • 🟢TestTBOperationHandlerCancellingOperationCompletedSuccessfully
  • 🟢TestTBOperationHandlerCancellingOperationInProgress
  • 🟢TestTBOperationHandlerDeadlineExceededForCancellingOperation
  • 🟢TestTBOperationHandlerDeadlineExceededForPendingOperation
  • 🟢TestTBOperationHandlerInvalidOperationResponse
  • 🟢TestTBOperationHandlerPendingOperationCancelled
  • 🟢TestTBOperationHandlerPendingOperationCompletedSuccessfully
  • 🟢TestTBOperationHandlerPendingOperationInProgress
  • 🟢TestTBOperationHandlerRetriableErrorForPendingOperation
🖨️ Output
=== RUN   TestRBOperationHandlerInvalidOperationResponse
2024-08-22T11:35:15.563Z	INFO	handlers/restore_backup.go:33	received operation	{"id": "315898a2-574d-41d8-ad94-b002a2f8c32f", "type": "RB", "state": "PENDING", "message": ""}
2024-08-22T11:35:15.563Z	INFO	handlers/utils.go:48	getting operation status	{"id": "315898a2-574d-41d8-ad94-b002a2f8c32f", "type": "RB", "ydb_operation_id": "1"}
--- PASS: TestRBOperationHandlerInvalidOperationResponse (0.00s)
=== RUN   TestRBOperationHandlerDeadlineExceededForPendingOperation
2024-08-22T11:35:15.564Z	INFO	handlers/restore_backup.go:33	received operation	{"id": "7a3e9fb8-1056-43f4-ad1a-bce23c2c8796", "type": "RB", "state": "PENDING", "message": ""}
2024-08-22T11:35:15.564Z	INFO	handlers/utils.go:48	getting operation status	{"id": "7a3e9fb8-1056-43f4-ad1a-bce23c2c8796", "type": "RB", "ydb_operation_id": "1"}
2024-08-22T11:35:15.564Z	INFO	handlers/utils.go:101	cancelling operation	{"reason": "TTL", "id": "7a3e9fb8-1056-43f4-ad1a-bce23c2c8796", "type": "RB", "ydb_operation_id": "1"}
--- PASS: TestRBOperationHandlerDeadlineExceededForPendingOperation (0.00s)
=== RUN   TestRBOperationHandlerPendingOperationInProgress
2024-08-22T11:35:15.564Z	INFO	handlers/restore_backup.go:33	received operation	{"id": "182f4e0a-f483-4573-8387-942a40a12efc", "type": "RB", "state": "PENDING", "message": ""}
2024-08-22T11:35:15.564Z	INFO	handlers/utils.go:48	getting operation status	{"id": "182f4e0a-f483-4573-8387-942a40a12efc", "type": "RB", "ydb_operation_id": "1"}
--- PASS: TestRBOperationHandlerPendingOperationInProgress (0.00s)
=== RUN   TestRBOperationHandlerPendingOperationCompletedSuccessfully
2024-08-22T11:35:15.564Z	INFO	handlers/restore_backup.go:33	received operation	{"id": "274b454d-6799-4f6e-8840-ffd9391dbc6a", "type": "RB", "state": "PENDING", "message": ""}
2024-08-22T11:35:15.565Z	INFO	handlers/utils.go:48	getting operation status	{"id": "274b454d-6799-4f6e-8840-ffd9391dbc6a", "type": "RB", "ydb_operation_id": "1"}
2024-08-22T11:35:15.565Z	INFO	handlers/restore_backup.go:124	forgetting operation	{"id": "274b454d-6799-4f6e-8840-ffd9391dbc6a", "type": "RB", "ydb_operation_id": "1"}
--- PASS: TestRBOperationHandlerPendingOperationCompletedSuccessfully (0.00s)
=== RUN   TestRBOperationHandlerPendingOperationCancelled
2024-08-22T11:35:15.565Z	INFO	handlers/restore_backup.go:33	received operation	{"id": "c6fbde83-4862-486e-969b-dddb6f9643b1", "type": "RB", "state": "PENDING", "message": ""}
2024-08-22T11:35:15.565Z	INFO	handlers/utils.go:48	getting operation status	{"id": "c6fbde83-4862-486e-969b-dddb6f9643b1", "type": "RB", "ydb_operation_id": "1"}
2024-08-22T11:35:15.565Z	INFO	handlers/restore_backup.go:124	forgetting operation	{"id": "c6fbde83-4862-486e-969b-dddb6f9643b1", "type": "RB", "ydb_operation_id": "1"}
--- PASS: TestRBOperationHandlerPendingOperationCancelled (0.00s)
=== RUN   TestRBOperationHandlerDeadlineExceededForCancellingOperation
2024-08-22T11:35:15.565Z	INFO	handlers/restore_backup.go:33	received operation	{"id": "ee6ff94d-b581-4077-932d-c569eb2421a8", "type": "RB", "state": "CANCELLING", "message": ""}
2024-08-22T11:35:15.565Z	INFO	handlers/utils.go:48	getting operation status	{"id": "ee6ff94d-b581-4077-932d-c569eb2421a8", "type": "RB", "ydb_operation_id": "1"}
--- PASS: TestRBOperationHandlerDeadlineExceededForCancellingOperation (0.00s)
=== RUN   TestRBOperationHandlerCancellingOperationInProgress
2024-08-22T11:35:15.565Z	INFO	handlers/restore_backup.go:33	received operation	{"id": "07a4576a-5879-482d-a89e-44328928510e", "type": "RB", "state": "CANCELLING", "message": ""}
2024-08-22T11:35:15.565Z	INFO	handlers/utils.go:48	getting operation status	{"id": "07a4576a-5879-482d-a89e-44328928510e", "type": "RB", "ydb_operation_id": "1"}
--- PASS: TestRBOperationHandlerCancellingOperationInProgress (0.00s)
=== RUN   TestRBOperationHandlerCancellingOperationCompletedSuccessfully
2024-08-22T11:35:15.566Z	INFO	handlers/restore_backup.go:33	received operation	{"id": "7ea6dc74-0039-4ce3-9538-e07a546094aa", "type": "RB", "state": "CANCELLING", "message": ""}
2024-08-22T11:35:15.566Z	INFO	handlers/utils.go:48	getting operation status	{"id": "7ea6dc74-0039-4ce3-9538-e07a546094aa", "type": "RB", "ydb_operation_id": "1"}
2024-08-22T11:35:15.566Z	INFO	handlers/restore_backup.go:124	forgetting operation	{"id": "7ea6dc74-0039-4ce3-9538-e07a546094aa", "type": "RB", "ydb_operation_id": "1"}
--- PASS: TestRBOperationHandlerCancellingOperationCompletedSuccessfully (0.00s)
=== RUN   TestRBOperationHandlerCancellingOperationCancelled
2024-08-22T11:35:15.566Z	INFO	handlers/restore_backup.go:33	received operation	{"id": "0b1ca515-931b-4084-8c5f-251f1e2c99ac", "type": "RB", "state": "CANCELLING", "message": ""}
2024-08-22T11:35:15.566Z	INFO	handlers/utils.go:48	getting operation status	{"id": "0b1ca515-931b-4084-8c5f-251f1e2c99ac", "type": "RB", "ydb_operation_id": "1"}
2024-08-22T11:35:15.566Z	INFO	handlers/restore_backup.go:124	forgetting operation	{"id": "0b1ca515-931b-4084-8c5f-251f1e2c99ac", "type": "RB", "ydb_operation_id": "1"}
--- PASS: TestRBOperationHandlerCancellingOperationCancelled (0.00s)
=== RUN   TestRBOperationHandlerRetriableErrorForPendingOperation
2024-08-22T11:35:15.566Z	INFO	handlers/restore_backup.go:33	received operation	{"id": "d38e86ed-e080-4e0a-86ce-e3b4f5d0ad86", "type": "RB", "state": "PENDING", "message": ""}
2024-08-22T11:35:15.566Z	INFO	handlers/utils.go:48	getting operation status	{"id": "d38e86ed-e080-4e0a-86ce-e3b4f5d0ad86", "type": "RB", "ydb_operation_id": "1"}
2024-08-22T11:35:15.566Z	INFO	handlers/utils.go:71	received retriable error	{"id": "d38e86ed-e080-4e0a-86ce-e3b4f5d0ad86", "type": "RB", "ydb_operation_id": "1"}
--- PASS: TestRBOperationHandlerRetriableErrorForPendingOperation (0.00s)
=== RUN   TestTBOperationHandlerInvalidOperationResponse
2024-08-22T11:35:15.567Z	INFO	handlers/utils.go:48	getting operation status	{"id": "9f116e14-e60b-4ccc-8d11-eee55780bdae", "type": "TB", "ydb_operation_id": "1"}
--- PASS: TestTBOperationHandlerInvalidOperationResponse (0.00s)
=== RUN   TestTBOperationHandlerDeadlineExceededForPendingOperation
2024-08-22T11:35:15.567Z	INFO	handlers/utils.go:48	getting operation status	{"id": "d138a913-fe48-4720-a975-ee4aebde83dd", "type": "TB", "ydb_operation_id": "1"}
2024-08-22T11:35:15.567Z	INFO	handlers/utils.go:101	cancelling operation	{"reason": "TTL", "id": "d138a913-fe48-4720-a975-ee4aebde83dd", "type": "TB", "ydb_operation_id": "1"}
--- PASS: TestTBOperationHandlerDeadlineExceededForPendingOperation (0.00s)
=== RUN   TestTBOperationHandlerPendingOperationInProgress
2024-08-22T11:35:15.567Z	INFO	handlers/utils.go:48	getting operation status	{"id": "d4cd59f8-8f90-426a-903e-81c812200b4c", "type": "TB", "ydb_operation_id": "1"}
--- PASS: TestTBOperationHandlerPendingOperationInProgress (0.00s)
=== RUN   TestTBOperationHandlerPendingOperationCompletedSuccessfully
2024-08-22T11:35:15.568Z	INFO	handlers/utils.go:48	getting operation status	{"id": "6fe9ad65-9070-4359-a327-3d08e5144bc0", "type": "TB", "ydb_operation_id": "1"}
--- PASS: TestTBOperationHandlerPendingOperationCompletedSuccessfully (0.00s)
=== RUN   TestTBOperationHandlerPendingOperationCancelled
2024-08-22T11:35:15.568Z	INFO	handlers/utils.go:48	getting operation status	{"id": "88b827f7-8852-4c04-80bc-7bbc36e42801", "type": "TB", "ydb_operation_id": "1"}
--- PASS: TestTBOperationHandlerPendingOperationCancelled (0.00s)
=== RUN   TestTBOperationHandlerDeadlineExceededForCancellingOperation
2024-08-22T11:35:15.568Z	INFO	handlers/utils.go:48	getting operation status	{"id": "cc5ce727-157d-4665-8d69-b4694229267e", "type": "TB", "ydb_operation_id": "1"}
--- PASS: TestTBOperationHandlerDeadlineExceededForCancellingOperation (0.00s)
=== RUN   TestTBOperationHandlerCancellingOperationInProgress
2024-08-22T11:35:15.569Z	INFO	handlers/utils.go:48	getting operation status	{"id": "dcf812ed-f7ac-4d12-9b65-65387838ef14", "type": "TB", "ydb_operation_id": "1"}
--- PASS: TestTBOperationHandlerCancellingOperationInProgress (0.00s)
=== RUN   TestTBOperationHandlerCancellingOperationCompletedSuccessfully
2024-08-22T11:35:15.569Z	INFO	handlers/utils.go:48	getting operation status	{"id": "ec8ad90a-08d1-4272-aa29-754809db5f48", "type": "TB", "ydb_operation_id": "1"}
--- PASS: TestTBOperationHandlerCancellingOperationCompletedSuccessfully (0.00s)
=== RUN   TestTBOperationHandlerCancellingOperationCancelled
2024-08-22T11:35:15.569Z	INFO	handlers/utils.go:48	getting operation status	{"id": "2d905d00-b269-40fe-b94d-564d1a357bef", "type": "TB", "ydb_operation_id": "1"}
--- PASS: TestTBOperationHandlerCancellingOperationCancelled (0.00s)
=== RUN   TestTBOperationHandlerRetriableErrorForPendingOperation
2024-08-22T11:35:15.569Z	INFO	handlers/utils.go:48	getting operation status	{"id": "0125c46a-d414-4c72-aa57-80cea2c8b3c9", "type": "TB", "ydb_operation_id": "1"}
2024-08-22T11:35:15.570Z	INFO	handlers/utils.go:71	received retriable error	{"id": "0125c46a-d414-4c72-aa57-80cea2c8b3c9", "type": "TB", "ydb_operation_id": "1"}
--- PASS: TestTBOperationHandlerRetriableErrorForPendingOperation (0.00s)
🟢 ydbcp/internal/processor2001020ms
🧪 Tests
  • 🟢TestOperationHandlerRegistry
  • 🟢TestProcessor
🖨️ Output
=== RUN   TestProcessor
2024-08-22T11:35:16.622Z	DEBUG	processor/processor.go:76	Operation Processor started	{"period": "10s"}
2024-08-22T11:35:16.622Z	DEBUG	processor/processor.go:108	operation already running	{"operation": "Operation, id 8035d7ae-a658-426b-b710-6f372e2c77fb, type TB, state PENDING"}
2024-08-22T11:35:16.622Z	DEBUG	processor/processor.go:120	start operation handler	{"operation": "Operation, id 8035d7ae-a658-426b-b710-6f372e2c77fb, type TB, state PENDING"}
2024-08-22T11:35:16.622Z	DEBUG	processor/processor.go:108	operation already running	{"operation": "Operation, id 8035d7ae-a658-426b-b710-6f372e2c77fb, type TB, state PENDING"}
2024-08-22T11:35:16.623Z	DEBUG	processor/processor_test.go:40	TB handler called for operation	{"operation": "Operation, id 8035d7ae-a658-426b-b710-6f372e2c77fb, type TB, state PENDING"}
2024-08-22T11:35:16.623Z	DEBUG	processor/processor.go:137	operation handler is finished	{"operationID": "8035d7ae-a658-426b-b710-6f372e2c77fb"}
2024-08-22T11:35:16.623Z	DEBUG	processor/processor.go:83	Operation Processor stopped
--- PASS: TestProcessor (0.00s)
=== RUN   TestOperationHandlerRegistry
--- PASS: TestOperationHandlerRegistry (0.00s)
🟡 ydbcp/internal/server0000ms
🧪 Tests(none)
🖨️ Output
(none)
🟢 ydbcp/internal/server/services/backup2001030ms
🧪 Tests
  • 🟢TestEndpointSecureValidation
  • 🟢TestEndpointValidation
🖨️ Output
=== RUN   TestEndpointValidation
--- PASS: TestEndpointValidation (0.00s)
=== RUN   TestEndpointSecureValidation
--- PASS: TestEndpointSecureValidation (0.00s)
🟡 ydbcp/internal/server/services/operation0000ms
🧪 Tests(none)
🖨️ Output
(none)
🟡 ydbcp/internal/types0000ms
🧪 Tests(none)
🖨️ Output
(none)
🟡 ydbcp/internal/util/ticker0000ms
🧪 Tests(none)
🖨️ Output
(none)
🟡 ydbcp/internal/util/timer0000ms
🧪 Tests(none)
🖨️ Output
(none)
🟡 ydbcp/internal/util/xlog0000ms
🧪 Tests(none)
🖨️ Output
(none)
🟡 ydbcp/pkg/plugins/auth0000ms
🧪 Tests(none)
🖨️ Output
(none)
🟡 ydbcp/pkg/proto/ydbcp/v1alpha10000ms
🧪 Tests(none)
🖨️ Output
(none)
🟡 ydbcp/plugins/auth_nebius0000ms
🧪 Tests(none)
🖨️ Output
(none)
🟡 ydbcp/plugins/auth_nebius/proto/iam/v10000ms
🧪 Tests(none)
🖨️ Output
(none)

@qrort qrort merged commit 245bd91 into main Aug 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants