<@U04S8PLJWMT> lets say I have an airbyte connecto...
# ask-ai
j
@kapa.ai lets say I have an airbyte connector reading from postgres and writing into databricks and it will be scheduled to run every minute using cron job. Now at t1 the data spiked and connector is running for last 5mins, what happens to the schedule will it pile up the schedules? even if piled up which cursor will it read since connector which was supposed to run at t2 is lagged by 5mins
k
If your Airbyte connection is scheduled to run every minute using a cron job, but a sync at time t1 takes longer (e.g., 5 minutes due to a data spike), Airbyte will not pile up multiple sync jobs for the same connection. Instead, only one sync per connection can run at a time. If a scheduled sync is supposed to start while a previous sync is still running, the new scheduled sync will wait and start only after the previous one finishes. This means that syncs are queued, not run in parallel or piled up for the same connection. Regarding the cursor: the next sync (e.g., the one scheduled for t2 but delayed due to the long-running t1 sync) will use the state/cursor from the end of the last completed sync. So, even if the t2 sync starts late, it will pick up from where the t1 sync left off, ensuring no data is missed or duplicated due to overlapping schedules. The cursor is always advanced based on the last successful sync, not the original scheduled time. Key points: - Only one sync per connection runs at a time. - If a sync is scheduled to run before the previous one finishes, it will start after the previous sync completes. - The cursor for incremental syncs is based on the last completed sync, not the scheduled time. References: - "Only one sync per connection can run at a time. If a sync is scheduled to run before the previous sync finishes, the scheduled sync will start after the completion of the previous sync." [Sync schedules (Airbyte docs)](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-schedules) - "Airbyte provides an at-least-once delivery guarantee... the cursor field will always be greater than or equal to itself, causing it to pull the latest row multiple times until there is new data at the source." [Incremental Sync - Append (Airbyte docs)](https://docs.airbyte.com/platform/1.7/using-airbyte/core-concepts/sync-modes/incremental-append#inclusive-cursors)
j
@kapa.ai so if the sync that was supposed to start is delayed due to current executing sync by 5mins, then there will be 5 syncs delayed. So will there 5 sync in queue? or just 1 sync in queue?
k
A message from kapa.ai
Based on the Airbyte documentation, only one sync per connection can run at a time. If a sync is scheduled to run before the previous sync finishes, the scheduled sync will start after the completion of the previous sync. The documentation does not mention that multiple scheduled syncs will be queued up; rather, it implies that only a single sync will be queued and executed after the current one finishes. In other words, if a sync is delayed, only one subsequent sync will be queued, not all the missed scheduled runs. So, in your scenario, even if 5 syncs were scheduled during the long-running sync, there will be just 1 sync in the queue for that connection, not 5. The system does not pile up all missed schedules; it simply ensures the next sync runs after the current one completes. > "Only one sync per connection can run at a time. If a sync is scheduled to run before the previous sync finishes, the scheduled sync will start after the completion of the previous sync." [Sync schedules (Airbyte docs)](https://docs.airbyte.com/platform/using-airbyte/core-concepts/sync-schedules) If you need more granular control or a different behavior, you may need to implement custom logic outside of Airbyte.