-
Notifications
You must be signed in to change notification settings - Fork 4.5k
🐛 Save Temporal Workflow Id to the DB instead of the Workspace volume. #5850
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
Conversation
@jrhizor heads up, turns out that this wasn't as straightforward as we thought. What do you think about the approach listed out? I think it would also close #2564 at the same time. I looked into using Temporal's metadata store and it looks like this requires elastisearch, so using the default workflow id in a DB seems o-kay to me. |
...er/persistence/src/test/java/io/airbyte/scheduler/persistence/DefaultJobPersistenceTest.java
Show resolved
Hide resolved
The failed unit test, |
@tuliren cool I'll delete it. Thanks! We'll have to do the same for the other test method for the config database. What's the best way for us to remember to clean this up? Is there an existing ticket or should I write one? |
I created a ticket: #5857 |
…ve test that Liren will later clean up.
airbyte-migration/src/test/java/io/airbyte/migrate/MigrationCurrentSchemaTest.java
Show resolved
Hide resolved
airbyte-server/src/test/java/io/airbyte/server/migration/RunMigrationTest.java
Show resolved
Hide resolved
airbyte-workers/src/main/java/io/airbyte/workers/temporal/TemporalAttemptExecution.java
Show resolved
Hide resolved
@tuliren since this is the first time we are doing a Flyway migration, I ran test to confirm backwards compatibility with previous versions and everything seemed to work. I stood up Airbyte on 0.29.15-alpha, performed one sync, spun down the server, then bring it up at version Can you confirm this is alright? Slightly nervous since our migration tests aren't completely working. |
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.
Looks good. Only minor comments.
Are we only going to merge this after the migration tests are fixed? I'm a bit worried about having disabled migration tests over any releases.
...irbyte/db/instance/jobs/migrations/V0_29_15_001__Add_temporalWorkflowId_col_to_Attempts.java
Outdated
Show resolved
Hide resolved
airbyte-workers/src/main/java/io/airbyte/workers/temporal/TemporalAttemptExecution.java
Outdated
Show resolved
Hide resolved
airbyte-workers/src/main/java/io/airbyte/workers/temporal/TemporalAttemptExecution.java
Show resolved
Hide resolved
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.
nice!
...irbyte/db/instance/jobs/migrations/V0_29_15_001__Add_temporalWorkflowId_col_to_Attempts.java
Outdated
Show resolved
Hide resolved
airbyte-migration/src/test/java/io/airbyte/migrate/MigrationCurrentSchemaTest.java
Show resolved
Hide resolved
...irbyte/db/instance/jobs/migrations/V0_29_15_001__Add_temporalWorkflowId_col_to_Attempts.java
Outdated
Show resolved
Hide resolved
...eduler/persistence/src/main/java/io/airbyte/scheduler/persistence/DefaultJobPersistence.java
Outdated
Show resolved
Hide resolved
airbyte-tests/src/acceptanceTests/java/io/airbyte/test/acceptance/AcceptanceTests.java
Outdated
Show resolved
Hide resolved
airbyte-tests/src/acceptanceTests/java/io/airbyte/test/acceptance/AcceptanceTests.java
Show resolved
Hide resolved
airbyte-workers/src/test/java/io/airbyte/workers/temporal/TemporalAttemptExecutionTest.java
Show resolved
Hide resolved
airbyte-workers/src/main/java/io/airbyte/workers/temporal/TemporalAttemptExecution.java
Show resolved
Hide resolved
airbyte-workers/src/main/java/io/airbyte/workers/temporal/TemporalAttemptExecution.java
Show resolved
Hide resolved
…oralAttemptExecution.java Co-authored-by: Jared Rhizor <[email protected]>
Yes, I think this is alright. Also I will add an acceptance test template for Flyway migration. Issue here: https://github.com/airbytehq/airbyte-internal-issues/issues/232 Will work on this when I copy the job attempt state to the configs database. This should make new migration easier to test. |
airbyte-db/lib/src/main/resources/jobs_database/schema_dump.txt
Outdated
Show resolved
Hide resolved
...eduler/persistence/src/main/java/io/airbyte/scheduler/persistence/DefaultJobPersistence.java
Show resolved
Hide resolved
Big PR review so going to summarise everything. @jrhizor with Liren's blessing I think it's okay to ship this without the migration tests since this is backwards compatible. As long as there are no additional migrations in the mean time we are ok. Liren is going to work on fixing this soon, so we should be ok. Remaining bits for both Charles and Jared to weigh in:
Thank you for bearing with me on this! |
If Liren's change is going to happen very short term, shouldn't it block this PR? If Liren's change isn't going to be merged very short term, then it doesn't seem safe to block any other change that might have a migration for that period. |
Spoke offline to Jared - merging this is okay since it only blocks schema migrations in the config database for the json blob. |
The Kube test is passing locally. Going to merge. |
What
A few days ago we removed the workflow volume from the Kubernetes deployment in order to simplify the set up. This also lets us do away with the
workspace
PVC.In theory this isn't needed since the volume is mainly used for logs and our Kube deployment logs out to the Cloud storage.
In the process of doing so, we realised the volume is used to store the temporal workflow id that is later used to cancel the workflow.
This PR:
temporalWorkflowId
column to theAttempts
table. Exposes various persistent methods for this.Things to call out:
Recommended reading order
Attempts.yaml
andV0_29_15_001__Add_temporalWorkflowId_col_to_Attempts.java
to understand the schema changes.JobPersistence.java
andDefaultJobPersistence.java
to understand how the new column is used.TemporalAttemptExecution.java
andSchedulerHandler.java
to understand how cancellation is happening.Pre-merge Checklist
Expand the relevant checklist and delete the others.
New Connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/SUMMARY.md
docs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampledocs/integrations/README.md
airbyte-integrations/builds.md
Airbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing./publish
command described hereUpdating a connector
Community member or Airbyter
airbyte_secret
./gradlew :airbyte-integrations:connectors:<name>:integrationTest
.README.md
bootstrap.md
. See description and examplesdocs/integrations/<source or destination>/<name>.md
including changelog. See changelog exampleAirbyter
If this is a community PR, the Airbyte engineer reviewing this PR is responsible for the below items.
/test connector=connectors/<name>
command is passing./publish
command described hereConnector Generator
-scaffold
in their name) have been updated with the latest scaffold by running./gradlew :airbyte-integrations:connector-templates:generator:testScaffoldTemplates
then checking in your changes