Hey Team, I was working on batch replacement of multiple segments. I am looking to atomically replace all the segments together. I understand that there is an api for replacing segments but how do i configure the whole flow. we are fine with doubling the storage during the ingestion phase.
m
Mayank
11/04/2020, 5:46 AM
@Seunghyun ^^
Mayank
11/04/2020, 5:47 AM
There's work that needs to be done for atomic swap
Mayank
11/04/2020, 5:48 AM
One way would be to version the segments, and only when all segments (old and new) are online in external view, you make the atomic switch.
Mayank
11/04/2020, 5:48 AM
Broker would have to know how to route query to one version vs other
y
Yash Agarwal
11/04/2020, 5:49 AM
Sure. How close or far are we from it?
m
Mayank
11/04/2020, 5:51 AM
So far there's only api's. The rest of the work needs to be done
s
Seunghyun
11/04/2020, 9:37 PM
@Yash Agarwal If you want to replace the segments atomically using the existing replaceSegment API, you need to do the following:
Let’s say that we want to replace the segments like the following:
(s1, s2, s3 ) -> (s4, s5, s6)
1. Call startReplacement:
• segmentsFrom: s1, s2, s3
• segmentsTo: s4, s5, s6
-> The api will return the Id (store this)
2. upload segment s4, s5,s6
3. Call endReplaceSegment
• provide Id that you got from the step 1.
Seunghyun
11/04/2020, 9:40 PM
So, until the step 3 is done, uploaded segment (s4, s5, s6) should not be used.
y
Yash Agarwal
11/04/2020, 9:46 PM
should not be used or would not be used ? i.e. will pinot handle not using s4,s5,s6 or does the user of the system needs to handle it.