<@U04S8PLJWMT> why is the sync for one connection ...
# ask-ai
f
@kapa.ai why is the sync for one connection so slow even ifs the same destination as all others: mongodb to postgres 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler(getInitialRawTableState$lambda$1):95 Retrieving table from Db metadata: panacee_analytics airbyte_internal panacee_meinestelle_raw__stream_channel_channels 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.i.d.p.PostgresGenerationHandler(getGenerationIdInTable):48 found generationId in table airbyte_internal.panacee_meinestelle_raw__stream_channel_channels: 9 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler$Companion(findExistingTable$lambda$1):541 Retrieving existing columns for panacee_analytics.panacee_meinestelle.channel_assignments 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler(getInitialRawTableState$lambda$1):95 Retrieving table from Db metadata: panacee_analytics airbyte_internal panacee_meinestelle_raw__stream_channel_assignments 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler(getInitialRawTableState$lambda$1):95 Retrieving table from Db metadata: panacee_analytics airbyte_internal panacee_meinestelle_raw__stream_channel_assignments 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.i.d.p.PostgresGenerationHandler(getGenerationIdInTable):48 found generationId in table airbyte_internal.panacee_meinestelle_raw__stream_channel_assignments: 9 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler$Companion(findExistingTable$lambda$1):541 Retrieving existing columns for panacee_analytics.panacee_meinestelle.analytics_campaign_statistics 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233318 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler(getInitialRawTableState$lambda$1):95 Retrieving table from Db metadata: panacee_analytics airbyte_internal panacee_meinestelle_raw__stream_analytics_campaign_statistics 2025-11-05 233319 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233319 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233319 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler(getInitialRawTableState$lambda$1):95 Retrieving table from Db metadata: panacee_analytics airbyte_internal panacee_meinestelle_raw__stream_analytics_campaign_statistics 2025-11-05 233319 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233319 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233319 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.i.d.p.PostgresGenerationHandler(getGenerationIdInTable):48 found generationId in table airbyte_internal.panacee_meinestelle_raw__stream_analytics_campaign_statistics: 9 2025-11-05 233319 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233319 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler$Companion(findExistingTable$lambda$1):541 Retrieving existing columns for panacee_analytics.panacee_meinestelle.campaign_campaigns 2025-11-05 233319 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233319 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler(getInitialRawTableState$lambda$1):95 Retrieving table from Db metadata: panacee_analytics airbyte_internal panacee_meinestelle_raw__stream_campaign_campaigns 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler(getInitialRawTableState$lambda$1):95 Retrieving table from Db metadata: panacee_analytics airbyte_internal panacee_meinestelle_raw__stream_campaign_campaigns 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.i.d.p.PostgresGenerationHandler(getGenerationIdInTable):48 found generationId in table airbyte_internal.panacee_meinestelle_raw__stream_campaign_campaigns: 9 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler$Companion(findExistingTable$lambda$1):541 Retrieving existing columns for panacee_analytics.panacee_meinestelle.organization_organizations 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler(getInitialRawTableState$lambda$1):95 Retrieving table from Db metadata: panacee_analytics airbyte_internal panacee_meinestelle_raw__stream_organization_organizations 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler(getInitialRawTableState$lambda$1):95 Retrieving table from Db metadata: panacee_analytics airbyte_internal panacee_meinestelle_raw__stream_organization_organizations 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.i.d.p.PostgresGenerationHandler(getGenerationIdInTable):48 found generationId in table airbyte_internal.panacee_meinestelle_raw__stream_organization_organizations: 9 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler$Companion(findExistingTable$lambda$1):541 Retrieving existing columns for panacee_analytics.panacee_meinestelle.publishing_jobs 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.d.j.DefaultJdbcDatabase(unsafeQuery$lambda$6):127 closing connection 2025-11-05 233320 destination > INFO ForkJoinPool.commonPool-worker-1 i.a.c.i.d.j.t.JdbcDestinationHandler(getInitialRawTableState$lambda$1):95 Retrieving table from Db metadata: panacee_analytics airbyte_internal panacee_meinestelle_raw__stream_publishing_jobs 2025-11-05 233416 destination > INFO pool-3-thread-1 i.a.c.i.d.a.b.BufferManager(printQueueInfo):94 [ASYNC QUEUE INFO] Global: max: 1.8 GB, allocated: 10 MB (10.0 MB), %% used: 0.005425347222783638 | State Manager memory usage: Allocated: 10 MB, Used: 0 bytes, percentage Used 0.0 2025-11-05 233416 destination > INFO pool-6-thread-1 i.a.c.i.d.a.FlushWorkers(printWorkerInfo):129 [ASYNC WORKER INFO] Pool queue size: 0, Active threads: 0
k
Based on the logs you've provided, I can see that your MongoDB to Postgres sync is spending a significant amount of time retrieving table metadata from the database. The logs show repeated queries like "Retrieving table from Db metadata" and "closing connection" for multiple streams, with timestamps showing this process taking considerable time (from 233318 to 233416, which is nearly a minute just for the metadata retrieval phase shown). While the knowledge sources don't contain a specific case exactly matching your MongoDB to Postgres scenario with these exact logs, there are several related performance issues documented: ## Potential Causes 1. Database Connection Overhead: Your logs show frequent connection opening and closing (
closing connection
appears repeatedly). This pattern can significantly slow down syncs, especially when dealing with multiple streams. 2. Long-lived Instance Issues: The knowledge sources mention that [Clearing storage area in destination increasingly slow on long-lived airbyte instances](https://discuss.airbyte.io/t/3620) can occur, where performance degrades over time on Airbyte instances that have been running for extended periods. 3. Metadata Query Performance: The destination is repeatedly querying database metadata for each stream, which can be slow if: - The Postgres database has performance issues - There are network latency issues between Airbyte and Postgres - The database has many tables or complex schemas ## Troubleshooting Steps Based on similar issues in the knowledge sources, here are some suggestions: 1. Check Resource Allocation: The knowledge sources indicate that [allocating more memory to connections](https://discuss.airbyte.io/t/2416) can sometimes help with performance issues. 2. Monitor System Resources: Check your Airbyte instance's memory and CPU usage using
docker stats
to see if there are resource constraints, as suggested in [Long loading time](https://discuss.airbyte.io/t/2536). 3. Restart Airbyte Components: If your instance has been running for a long time, restarting the airbyte-server and airbyte-worker containers may help, as mentioned in the [Long loading time](https://discuss.airbyte.io/t/2536) discussion. 4. Check Postgres Performance: Since the bottleneck appears to be in the metadata retrieval phase, investigate your Postgres database performance, particularly for metadata queries. Unfortunately, the knowledge sources don't contain specific information about why one MongoDB to Postgres connection would be slower than others with the same destination. You may want to compare the number of streams, table structures, and data volumes between your connections to identify differences that could explain the performance disparity.
f
@kapa.ai i assigned 12 gb ram and 3 cpus for this connection
k
A message from kapa.ai
Based on your resource allocation of 12 GB RAM and 3 CPUs, and looking at the logs you provided earlier, the issue doesn't appear to be resource-related. The logs show very low resource utilization:
Copy code
[ASYNC QUEUE INFO] Global: max: 1.8 GB, allocated: 10 MB (10.0 MB), %% used: 0.005425347222783638
This indicates that only 10 MB is being used out of the available memory, which is far below your 12 GB allocation. ## Key Observations According to the [Scaling Airbyte](https://docs.airbyte.com/platform/operator-guides/scaling-airbyte#what-to-scale) documentation, the Source worker is typically the main memory consumer during syncs, as it reads up to 10,000 records in memory. However, your logs show the bottleneck is in the destination's metadata retrieval phase, not in the source reading or destination writing phases. The pattern in your logs shows: - Repeated metadata queries for each stream - Frequent connection opening and closing - Very low actual resource usage despite high allocation ## What This Suggests Since you've already allocated substantial resources (12 GB RAM and 3 CPUs) and the actual usage is minimal, the slowness is likely due to: 1. Database-side performance: The Postgres destination may be slow in responding to metadata queries 2. Network latency: Communication between Airbyte and the Postgres database 3. Database connection pool issues: The frequent connection opening/closing pattern suggests potential connection management inefficiencies The knowledge sources indicate that simply increasing
JOB_MAIN_CONTAINER_MEMORY_REQUEST
and similar variables [may not improve performance](https://discuss.airbyte.io/t/1842) if the bottleneck isn't resource-related, which appears to be your case. Unfortunately, the knowledge sources don't provide specific solutions for optimizing the metadata retrieval phase that's causing your slowdown. You may need to investigate the Postgres database performance and network connectivity between Airbyte and Postgres to identify the root cause.
f
@kapa.ai the destination has 3 postgress nodes with 8 gb ram and 2 vcpus and pgpool
k
A message from kapa.ai
Based on your Postgres destination setup (3 nodes with 8 GB RAM and 2 vCPUs each, with pgpool), and considering the logs you shared earlier, the issue appears to be related to how the destination is handling the metadata queries rather than raw compute resources. ## Relevant Considerations from the Knowledge Sources The [Postgres Troubleshooting documentation](https://docs.airbyte.com/integrations/destinations/postgres/postgres-troubleshooting#connector-limitations) provides important context: 1. Postgres is not a Data Warehouse: The documentation explicitly states that "Postgres, while an excellent relational database, is not a data warehouse" and recommends "only consider using postgres as a destination for small data volumes (e.g. less than 10GB) or for testing purposes." 2. Performance Issues with Large Syncs: The documentation warns that "Postgres is likely to perform poorly with large data volumes" and specifically mentions that when using typing and deduplication with
destination-postgres
, you should "monitor your database's memory and CPU usage during your syncs. It is possible for your destination to 'lock up', and incur high usage costs with large sync volumes." 3. Scaling Considerations: The documentation notes that "when attempting to scale a postgres database to handle larger data volumes, scaling IOPS (disk throughput) is as important as increasing memory and compute capacity." ## What This Means for Your Setup Your logs show the destination is performing many sequential metadata queries with frequent connection opening and closing. With pgpool in front of your Postgres cluster, this pattern could be creating additional overhead in connection management and query routing. The knowledge sources don't provide specific guidance on optimizing Postgres destinations with pgpool configurations or multi-node setups. However, the repeated pattern of metadata queries in your logs suggests that the bottleneck is in how the destination connector interacts with your Postgres setup, rather than the raw resources available. Unfortunately, the knowledge sources don't contain specific solutions for optimizing metadata retrieval performance in multi-node Postgres setups with pgpool. The documentation primarily recommends using dedicated data warehouses like BigQuery, Snowflake, or Redshift for larger data volumes instead of Postgres.
f
@kapa.ai postgres is using 60m cpu and 300mb ram currently on all nodes
k
A message from kapa.ai
Based on your Postgres resource usage (60m CPU and 300MB RAM across all nodes), your destination database is clearly not resource-constrained. This aligns with the pattern we've been observing throughout this conversation. ## Summary of the Situation 1. Airbyte connection: Allocated 12 GB RAM and 3 CPUs, but using only ~10 MB 2. Postgres destination: 3 nodes with 8 GB RAM and 2 vCPUs each, currently using only 60m CPU and 300MB RAM 3. Bottleneck: The logs show the sync is spending significant time on metadata retrieval queries with frequent connection opening/closing ## What the Knowledge Sources Tell Us The [Scaling Airbyte documentation](https://docs.airbyte.com/platform/operator-guides/scaling-airbyte#what-to-scale) explains that when thinking about scale, we're mainly concerned with Memory and Disk space. However, in your case, neither resource is being heavily utilized. The knowledge sources contain several discussions about slow sync performance where users had adequate resources but still experienced slowness: - In [Ideas for sync jobs speed up](https://discuss.airbyte.io/t/1168), a user reported similar low resource usage (162MB RAM and minimal CPU) despite having allocated more resources, and was advised that "if the problem is with the pulling/sending data and not with memory changing that variable won't make much sense because you would already be having enough resources." - The [Postgres Troubleshooting documentation](https://docs.airbyte.com/integrations/destinations/postgres/postgres-troubleshooting#connector-limitations) notes that Postgres destinations can experience performance issues even when resources appear adequate, particularly with typing and deduplication operations. ## The Core Issue Given that both your Airbyte instance and Postgres destination have ample unused resources, the slowness is likely due to: 1. Connection management overhead: The frequent connection opening/closing pattern in your logs 2. Metadata query efficiency: How the destination connector retrieves table metadata 3. Network latency: Communication between Airbyte and Postgres through pgpool Unfortunately, the knowledge sources don't provide specific solutions for optimizing the metadata retrieval phase or connection management patterns that are causing your slowdown. The performance bottleneck appears to be in the connector's interaction pattern with the database rather than resource availability.
f
@kapa.ai so how can i make the threat use more then 10 mb of ram?
k
A message from kapa.ai
Based on the knowledge sources, the issue you're experiencing is not about forcing the thread to use more RAM. The low memory usage (10 MB) you're seeing is actually a symptom, not the cause of your slow sync performance. ## Why Increasing Memory Won't Help The knowledge sources provide clear evidence that simply allocating more memory doesn't necessarily improve performance when the bottleneck isn't resource-related: From the [How to speed up airbyte Jobs](https://discuss.airbyte.io/t/1842) discussion, a user reported: > "My reading pod is using around 162MB and
0.0000533
of CPU. My writing pod is using around 163Mb and
0.00000717
of CPU. This is way below the values set with
JOB_MAIN_CONTAINER_*
values" The response clarified: "if the problem is with the pulling/sending data and not with memory changing that variable won't make much sense because you would already be having enough resources." Similarly, in [Optimized Postgres source connector performance](https://discuss.airbyte.io/t/1984), a user noted: > "I found even I distribute more resource to the container
JOB_MAIN_CONTAINER_MEMORY_REQUEST
there is no improvement. There are still some room of memories for postgres connector I wondering if the slowness is relate to the idel memory resource?" ## Understanding Memory Usage in Airbyte According to the [How memory request and limit works under the hood](https://discuss.airbyte.io/t/2214) discussion, memory usage depends on the connector type: - Source connectors: Read data in batches, and it's not possible to know the size of these batches before reading them - Destination connectors: Read records until they hit a batch size, currently set at 10k records The [Scaling Airbyte documentation](https://docs.airbyte.com/platform/operator-guides/scaling-airbyte#what-to-scale) explains that "the Source worker reads up to 10,000 records in memory." ## The Real Issue Your logs show the bottleneck is in the metadata retrieval phase of the destination connector, not in the data reading or writing phases. The connector is spending time querying database metadata and opening/closing connections repeatedly. This is a connector behavior issue, not a memory allocation issue. Unfortunately, the knowledge sources don't provide a way to force the connector to use more memory or to optimize the metadata retrieval pattern that's causing your slowdown. The low memory usage indicates the connector simply doesn't need more memory for the operations it's currently performing.
f
@kapa.ai all other connections interacting with the same systems are finished alrwady while this connection is stuck at 1200 records the ohters had 120.000 records
k
A message from kapa.ai
Based on the information you've provided throughout this conversation, you have a significant performance discrepancy where other connections to the same systems have completed syncing 120,000 records while this particular connection is stuck at only 1,200 records. ## What the Knowledge Sources Tell Us About Similar Issues The knowledge sources document several cases of connections getting stuck during syncs: 1. [PostgresSQL - Records Read gets stuck at specific number](https://discuss.airbyte.io/t/1465): A user reported that "At a specific point, the records read to get stuck. Tried to re-sync the data again but it gets stuck at the same number." The support response asked to check memory usage of the airbyte containers while running the sync. 2. [Postgres sync getting stuck at a specific point during sync](https://discuss.airbyte.io/t/2703): A user reported that "Postgres sync is getting stuck at a specific point every time we try to run it" and noted that "I tried cancelling and retrying the sync a few times but each time it is getting stuck at the same point (93K records / 315 MB)." The support agent suggested trying to replicate to another destination to isolate whether the issue was with the source or destination. 3. [Postgres CDC connector stuck, never stops reading from source](https://discuss.airbyte.io/t/4373): This discussion revealed that the issue was related to back pressure from the destination and lack of frequent checkpointing in CDC. The solution involved limiting the number of tables per connection. ## Potential Causes Based on Your Situation Given that: - Other connections to the same Postgres destination complete successfully with much larger data volumes (120,000 records) - This specific connection is stuck at 1,200 records - Your logs show extensive metadata retrieval operations - Both Airbyte and Postgres have ample unused resources The issue appears to be specific to this particular connection configuration rather than a general system resource problem. ## Recommended Actions Based on the knowledge sources, here are the troubleshooting steps you should take: 1. Cancel and check the logs: As suggested in the [PostgresSQL - Records Read gets stuck](https://discuss.airbyte.io/t/1465) discussion, cancel the current sync and examine the complete sync logs to identify where exactly it's getting stuck. 2. Compare connection configurations: Since other connections to the same destination work fine, compare the configuration of this problematic connection with the working ones. Look for differences in: - Number of streams/tables being synced - Sync modes (full refresh vs incremental) - Any connection-specific settings 3. Test with fewer streams: The [Postgres CDC connector](https://discuss.airbyte.io/t/4373) discussion recommended "Limit the number of tables to maximum 30 per connection using CDC." If your connection has many streams, try reducing the number to isolate the issue. Unfortunately, the knowledge sources don't provide specific guidance on why one connection would get stuck at a low record count while others complete successfully with the same destination. The pattern you're describing suggests there may be something specific about this connection's configuration or the data it's trying to sync that's causing the issue.
f
@kapa.ai how can i make replication job only use specific nodes in kubernetes
k
A message from kapa.ai
To make Airbyte replication jobs (connector pods) use specific Kubernetes nodes, configure node selectors for job pods. You can do this either via: --- ## 1. Environment variables (Helm v1 / workload-launcher) Set
JOB_KUBE_NODE_SELECTORS
to define default node selectors for sync jobs, and optionally override per job type with the job-specific vars. [[Jobs](https://docs.airbyte.com/platform/operator-guides/configuring-airbyte#jobs); [Jobs-specific](https://docs.airbyte.com/platform/operator-guides/configuring-airbyte#jobs-specific)] Example
values.yaml
(Helm chart v1):
Copy code
yaml workload-launcher:   nodeSelector:     type: static   extraEnv:     - name: JOB_KUBE_NODE_SELECTORS       value: type=jobs     - name: SPEC_JOB_KUBE_NODE_SELECTORS       value: type=jobs     - name: CHECK_JOB_KUBE_NODE_SELECTORS       value: type=jobs     - name: DISCOVER_JOB_KUBE_NODE_SELECTORS       value: type=jobs
In this setup: - All job pods (sync) default to nodes with label
type=jobs
via
JOB_KUBE_NODE_SELECTORS
. [[Multiple node groups 1.8](https://docs.airbyte.com/platform/1.8/enterprise-setup/scaling-airbyte#multiple-node-groups)] - SPEC/CHECK/DISCOVER jobs are explicitly pinned using their
*_JOB_KUBE_NODE_SELECTORS
overrides. [[Jobs-specific 1.8](https://docs.airbyte.com/platform/1.8/operator-guides/configuring-airbyte#jobs-specific)] Note: There was a known behavior where non-sync jobs did not fall back to
JOB_KUBE_NODE_SELECTORS
, requiring all
SPEC_/CHECK_/DISCOVER_
env vars to be set explicitly. [[Forum node selectors](https://discuss.airbyte.io/t/4533)] --- ## 2. Helm chart v2 global config If you’re using Helm chart v2, you can configure job scheduling centrally: [[Multiple node groups 1.8](https://docs.airbyte.com/platform/1.8/enterprise-setup/scaling-airbyte#multiple-node-groups)]
Copy code
yaml global:   jobs:     kube:       nodeSelector:         type: jobs          # default for sync jobs       scheduling:         check:           nodeSelectors:             type: jobs         discover:           nodeSelectors:             type: jobs         spec:           nodeSelectors:             type: jobs
This makes all Airbyte job pods (sync, check, discover, spec) scheduled only on nodes labeled
type=jobs
. --- ## 3. Label your Kubernetes nodes Ensure your target nodes are labeled accordingly, e.g.:
Copy code
bash kubectl label nodes <node-name> type=jobs
Then Airbyte job pods will only schedule on those nodes that match the selector. --- If you share which Helm chart version you’re using (v1 vs v2), I can show the exact snippet tailored to it.
f
@kapa.ai without the helmchart?
k
A message from kapa.ai
Without the Helm chart, you still use the same mechanism: set the job-related environment variables in the Airbyte deployment that launches jobs (worker / workload-launcher / server, depending on your setup). These env vars control node selectors for all Kubernetes job pods. [[Jobs](https://docs.airbyte.com/platform/operator-guides/configuring-airbyte#jobs); [Jobs-specific](https://docs.airbyte.com/platform/operator-guides/configuring-airbyte#jobs-specific)] ### 1. Set node selector env vars on the Airbyte component Add these environment variables to the relevant Airbyte container spec (e.g. in your `Deployment`/`StatefulSet` YAML):
Copy code
yaml env:   - name: JOB_KUBE_NODE_SELECTORS     value: type=jobs   - name: SPEC_JOB_KUBE_NODE_SELECTORS     value: type=jobs   - name: CHECK_JOB_KUBE_NODE_SELECTORS     value: type=jobs   - name: DISCOVER_JOB_KUBE_NODE_SELECTORS     value: type=jobs
Meaning: -
JOB_KUBE_NODE_SELECTORS
– default node selectors for sync jobs, and fallback for others. [[Jobs](https://docs.airbyte.com/platform/operator-guides/configuring-airbyte#jobs)] -
SPEC_JOB_KUBE_NODE_SELECTORS
,
CHECK_JOB_KUBE_NODE_SELECTORS
,
DISCOVER_JOB_KUBE_NODE_SELECTORS
– override per job type. [[Jobs-specific](https://docs.airbyte.com/platform/operator-guides/configuring-airbyte#jobs-specific)] Because the fallback from
JOB_KUBE_NODE_SELECTORS
to other job types was not working in some versions, explicitly setting all four variables is recommended. [[Forum node selectors](https://discuss.airbyte.io/t/4533); [Multiple node groups](https://docs.airbyte.com/platform/enterprise-setup/scaling-airbyte#multiple-node-groups)] ### 2. Label the target Kubernetes nodes Label the nodes you want to run jobs on:
Copy code
bash kubectl label node <node-name> type=jobs
Now, all Airbyte job pods (sync, spec, check, discover) will only schedule onto nodes with
type=jobs
, regardless of whether you use Helm.
f
and the values for the selectors are labels?
@kapa.ai and the values for the selectors are labels?
k
A message from kapa.ai
Yes. The values you set in the
*_JOB_KUBE_NODE_SELECTORS
variables must match Kubernetes node labels. Per the jobs configuration docs, these vars are defined as “one or more pod node selectors,” with each selector expressed as
key=value
and multiple pairs separated by commas. [[Jobs-specific](https://docs.airbyte.com/platform/operator-guides/configuring-airbyte#jobs-specific)] Example from the docs:
Copy code
text SPEC_JOB_KUBE_NODE_SELECTORS - Defines one or more pod node selectors for the spec job.  Each k=v pair is separated by a `,`. For example: key1=value1,key2=value2
So if your nodes are labeled like:
Copy code
bash kubectl label node my-node role=airbyte-jobs environment=prod
you would configure:
Copy code
bash SPEC_JOB_KUBE_NODE_SELECTORS=role=airbyte-jobs,environment=prod CHECK_JOB_KUBE_NODE_SELECTORS=role=airbyte-jobs,environment=prod DISCOVER_JOB_KUBE_NODE_SELECTORS=role=airbyte-jobs,environment=prod JOB_KUBE_NODE_SELECTORS=role=airbyte-jobs,environment=prod
f
@kapa.ai and in what deployment i should set them
k
A message from kapa.ai
You don’t need to pick a specific Kubernetes deployment in the docs sense; you set these variables wherever Airbyte’s job launcher / worker process runs, because that’s what creates the Kubernetes job pods with the node selectors. In the official Helm setups, these env vars are attached to the workload-launcher component (Helm v1) or configured via
global.jobs.kube.*
for all jobs (Helm v2). [[Multiple node groups 1.6](https://docs.airbyte.com/platform/1.6/enterprise-setup/scaling-airbyte#multiple-node-groups); [Chart v2 upgrade](https://docs.airbyte.com/platform/enterprise-setup/chart-v2-enterprise#update-your-valuesyaml-file)] Examples from Helm v1 Enterprise docs (note where the vars live): [[Multiple node groups 1.7](https://docs.airbyte.com/platform/1.7/enterprise-setup/scaling-airbyte#multiple-node-groups)]
Copy code
yaml workload-launcher:   nodeSelector:     type: static   extraEnvs:     - name: JOB_KUBE_NODE_SELECTORS       value: type=jobs     - name: SPEC_JOB_KUBE_NODE_SELECTORS       value: type=jobs     - name: CHECK_JOB_KUBE_NODE_SELECTORS       value: type=jobs     - name: DISCOVER_JOB_KUBE_NODE_SELECTORS       value: type=jobs
So, without Helm: - Identify the pod/container that plays the role of workload launcher / job orchestrator / worker in your deployment (the thing that submits the connector Kubernetes jobs). - Add these env vars to that pod’s spec:
Copy code
yaml env:   - name: JOB_KUBE_NODE_SELECTORS     value: type=jobs   - name: SPEC_JOB_KUBE_NODE_SELECTORS     value: type=jobs   - name: CHECK_JOB_KUBE_NODE_SELECTORS     value: type=jobs   - name: DISCOVER_JOB_KUBE_NODE_SELECTORS     value: type=jobs
The docs don’t spell out non‑Helm deployment names, only the Helm components; I’m inferring that you must set them on the component responsible for launching jobs (the equivalent of
workload-launcher
), since that’s where they’re set in all documented examples.
f
@kapa.ai how can i add tolerations to replication jobs
k
A message from kapa.ai
You add tolerations to replication (job) pods by setting the
JOB_KUBE_TOLERATIONS
(and related) environment variables on the component that launches jobs (workload‑launcher / worker), so they get propagated to all Kubernetes Job pods. From the jobs configuration docs: [[Config jobs](https://docs.airbyte.com/platform/operator-guides/configuring-airbyte#jobs)] >
JOB_KUBE_TOLERATIONS
– Defines one or more Job pod tolerations. > Tolerations are separated by
;
. > Each toleration contains k=v pairs mentioning some/all of
key
,
effect
,
operator
and
value
and separated by
,
. ### 1. Define tolerations via env vars Example (for all sync jobs):
Copy code
yaml env:   - name: JOB_KUBE_TOLERATIONS     value: "key=node-group,operator=Equal,value=airbyte-workers,effect=NoSchedule"
If you also want specific tolerations per job type (spec/check/discover), use the job‑specific env vars (same format): [[Config jobs](https://docs.airbyte.com/platform/operator-guides/configuring-airbyte#jobs)]
Copy code
yaml env:   - name: JOB_KUBE_TOLERATIONS     value: "key=node-group,operator=Equal,value=airbyte-workers,effect=NoSchedule"   - name: SPEC_JOB_KUBE_TOLERATIONS     value: "key=node-group,operator=Equal,value=airbyte-workers,effect=NoSchedule"   - name: CHECK_JOB_KUBE_TOLERATIONS     value: "key=node-group,operator=Equal,value=airbyte-workers,effect=NoSchedule"   - name: DISCOVER_JOB_KUBE_TOLERATIONS     value: "key=node-group,operator=Equal,value=airbyte-workers,effect=NoSchedule"
In Helm v1 this is done via
workload-launcher.extraEnv
, and the same envs are used when configuring tolerations globally for jobs. [[Scaling multiple node groups](https://docs.airbyte.com/platform/enterprise-setup/scaling-airbyte#multiple-node-groups); [[Helm values snippet](https://github.com/airbytehq/airbyte/issues/49843)] > Example from the chart comments: >
JOB_KUBE_TOLERATIONS: "key=airbyte-server,operator=Equals,value=true,effect=NoSchedule"
[[Helm tolerations example](https://github.com/airbytehq/airbyte/issues/49843)] ### 2. Ensure your nodes are tainted accordingly Kubernetes will only schedule the job pods onto nodes whose taints match the tolerations you configured.
Copy code
bash kubectl taint nodes <node-name> node-group=airbyte-workers:NoSchedule
### 3. Notes / pitfalls from issues - Tolerations must include
effect
to be applied; users observed that omitting
effect
made them no‑op. [[Forum tolerations](https://discuss.airbyte.io/t/2153)] - When set correctly, tolerations are passed as pod‑level tolerations on the job pods; examples using this pattern are shown in real configs: [[EKS example](https://github.com/airbytehq/airbyte/issues/59730)] If you share how you deploy Airbyte (Helm vs raw manifests), I can show the exact YAML block for your setup.