cancel
Showing results for 
Search instead for 
Did you mean: 

Lost contact with Snaplex node

msalter
New Contributor II

I have a very small pipeline (3 snaps) that I’m reading from a SQL table and writing the results to a new table in the same DB. I keep getting an error: Lost contact with Snaplex node while the pipeline was running. The select statement is pulling 250+M records and I’m using the Azure bulk insert to write. In order to avoid this error I keep having to reduce the batch size, from 20K to 10K to now 8K. Any thoughts on what could be causing the error?

1 ACCEPTED SOLUTION

koryknick
Employee
Employee

@darshthakkar - I believe @dmiller is correct that the Shard Offsets is a custom snap. I’ve replicated the logic with core snaps and built in expressions. See the attached example.
Shard Example_2023_07_05.slp (5.6 KB)

The Mapper is where the magic happens.

sl.range(0, $TOTAL, Math.ceil ($TOTAL / parseInt(_shard_count)))
.map((val,idx,arr)=> 
  idx == arr.length - 1 
  ? { offset : val, limit : $TOTAL - val } 
  : { offset : val, limit : arr[idx + 1] - val } 
)

First, use the sl.range() built-in function to generate an array with the offsets to be used, then use Array.map() method to recreate the simple array of integers as an array of objects to provide both the offset and limit for each shard.

After the Mapper, just use a JSON Splitter to get a new document for each limit and offset combination (same as Shard Offsets snap) that would feed your child pipeline with the Pipeline Execute.

Hope this helps!

View solution in original post

18 REPLIES 18

Hello @koryknick on the screenshot, you are seeing that failure due to AWS account (on the child pipeline) cuz the child pipeline (during validation) is trying to resolve the _FILE_URI (DYNAMIC VALUE)  coming from parent, (pls ignore that); when I run the parent pipeline, it will not show that issue. That is because, it is getting the value of the S3 uri from the parent, the pipeline is running fine, it is inserting when there are less than 2m records. When the file size is large, it fails with "Lost contact with Snaplex node" and it is due to large volume. And will open the separate thread from next time

@ashis1upreti - please go ahead and open a new thread on this topic.  Describe your pipelines as completely as possible.  If you can simplify the pipelines and still produce the error, that is also very helpful to avoid unnecessary overhead that has to be interpreted when trying to help diagnose. 

When posting, I recommend you don't call out individuals so that others in the Community can try to help answer and you don't need to wait on me if I am busy with project work.  

thanks will do!

darshthakkar
Valued Contributor

@dmiller - Can we please mark @koryknick’s comment as a solution to this thread?
Thanking you in advance.