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

Flexible scheduling: p_item data deduplication #2611

Closed
6 of 10 tasks
Tracked by #204
jpbruinsslot opened this issue Mar 6, 2024 · 2 comments
Closed
6 of 10 tasks
Tracked by #204

Flexible scheduling: p_item data deduplication #2611

jpbruinsslot opened this issue Mar 6, 2024 · 2 comments
Assignees
Labels
mula Issues related to the scheduler

Comments

@jpbruinsslot
Copy link
Contributor

jpbruinsslot commented Mar 6, 2024

Testing if we can solve some p_item data duplication.

Place data (BoefjeTask, NormalizerTask, etc.) in Task definition instead of embedding a p_item in a Task and other models. Then reference the Task in TaskRun, TaskSchedule and PrioritizedItem.

Alternative 1

erDiagram
task_runs {
    uuid id PK
    uuid task_id FK
    timestamp_with_time_zone created_at
    character_varying scheduler_id
    character_varying type
    taskstatus status
    timestamp_with_time_zone modified_at
}
tasks {
    uuid id PK
    jsonb data
    character_varying hash
}
task_schedules {
    uuid id PK
    uuid task_id FK
    boolean enabled
    character_varying scheduler_id
    character_varying cron_expression
    timestamp_with_time_zone deadline_at
    timestamp_with_time_zone evaluated_at
    timestamp_with_time_zone created_at
    timestamp_with_time_zone modified_at
}
p_items {
    uuid id PK
    uuid task_id FK
    timestamp_with_time_zone modified_at
    timestamp_with_time_zone created_at
    character_varying scheduler_id
    character_varying hash
    integer priority
}


task_runs }o--|| tasks: ""
task_schedules ||--|| tasks: ""
p_items ||--|| tasks: ""
Loading

Alternative 2

erDiagram
tasks {
    uuid id PK
    uuid schema_id FK
    timestamp_with_time_zone created_at
    character_varying scheduler_id
    character_varying type
    taskstatus status
    timestamp_with_time_zone modified_at
}
schemas {
    uuid id PK
    jsonb data
    character_varying hash
    character_varying schedule
    boolean enabled
    timestamp_with_time_zone deadline_at
    timestamp_with_time_zone created_at
    timestamp_with_time_zone modified_at
}
p_items {
    uuid id PK
    uuid task_id FK
    timestamp_with_time_zone modified_at
    timestamp_with_time_zone created_at
    character_varying scheduler_id
    character_varying hash
    integer priority
}


tasks }o--|| schemas: ""
p_items ||--|| tasks: ""
Loading

Alternative 3

As per discussion with @Donnype

erDiagram
task {
    uuid id PK
    uuid task_definition_id FK
    character_varying scheduler_id
    integer priority
    timestamp_with_time_zone created_at
    character_varying type
    taskstatus status
    timestamp_with_time_zone modified_at
}
task_definition {
    uuid id PK
    jsonb data
    character_varying hash
    character_varying schedule
    boolean enabled
    timestamp_with_time_zone deadline_at
    timestamp_with_time_zone created_at
    timestamp_with_time_zone modified_at
}

task }o--|| task_definition: ""
Loading

TODO:

@jpbruinsslot jpbruinsslot mentioned this issue Mar 6, 2024
36 tasks
@jpbruinsslot jpbruinsslot added the mula Issues related to the scheduler label Mar 6, 2024
@jpbruinsslot jpbruinsslot self-assigned this Mar 7, 2024
@jpbruinsslot jpbruinsslot added this to KAT Mar 7, 2024
@github-project-automation github-project-automation bot moved this to Incoming features / Need assessment in KAT Mar 7, 2024
@jpbruinsslot jpbruinsslot moved this from Incoming features / Need assessment to In Progress in KAT Mar 7, 2024
@jpbruinsslot jpbruinsslot moved this from In Progress to Todo (In this sprint) in KAT Mar 11, 2024
@jpbruinsslot jpbruinsslot changed the title Flexible scheduling: give p_item own table Flexible scheduling: p_item data depliccation Mar 12, 2024
@jpbruinsslot jpbruinsslot changed the title Flexible scheduling: p_item data depliccation Flexible scheduling: p_item data deduplication Mar 12, 2024
@jpbruinsslot jpbruinsslot moved this from Todo (In this sprint) to In Progress in KAT Mar 13, 2024
@jpbruinsslot jpbruinsslot linked a pull request Mar 14, 2024 that will close this issue
4 tasks
@jpbruinsslot jpbruinsslot moved this from In Progress to Todo (In this Sprint) in KAT Mar 18, 2024
@jpbruinsslot
Copy link
Contributor Author

@Donnype as per our discussion, I've added your suggestion as alternative 3. While trying out an implementation I came across some difficulties, perhaps nice to discuss this in a call?

@jpbruinsslot jpbruinsslot moved this from Todo (In this Sprint) to Backlog / Refined tasks in KAT Mar 28, 2024
@jpbruinsslot jpbruinsslot removed a link to a pull request Apr 4, 2024
4 tasks
@jpbruinsslot jpbruinsslot linked a pull request Apr 4, 2024 that will close this issue
9 tasks
@jpbruinsslot
Copy link
Contributor Author

Closing this issue in favour of #204 together with @Donnype we're proposing the third alternative mentioned here and picking this up in #204

@github-project-automation github-project-automation bot moved this from Backlog / Refined tasks to Done in KAT Apr 11, 2024
@jpbruinsslot jpbruinsslot removed a link to a pull request May 14, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mula Issues related to the scheduler
Projects
Archived in project
Development

No branches or pull requests

1 participant