Hi Team, encountered an issue with Realtime Table ...
# troubleshooting
a
Hi Team, encountered an issue with Realtime Table upsert mode. I have a primary key, which is present in Realtime Completed Segment. When i am pushing the same primary with some updated values now, query is retruning 2 rows. Consuming Segment is on Server1 and completed segment is present to Server2.( i,e another server) Can someone help?
m
Can you explain what you mean by this:
When i am pushing the same primary with some updated values now, query is retruning 2 rows.
a
so basically, i have moved completed segment to another server, and when i am trying to update a row. query is returning 2 rows instead of 1. ( old and new row)
@Neha Pawar @Mayank can you help here
m
While we wait for them, I was wondering if moving the segment to another server had broken this requirement:
Copy code
The upsert Pinot table can use only the low-level consumer for the input streams. As a result, it uses the partitioned replica-group assignment for the segments. Moreover,upsert poses the additional requirement that all segments of the same partition must be served from the same server to ensure the data consistency across the segments.
(https://docs.pinot.apache.org/basics/data-import/upsert#use-strictreplicagroup-for-routing)
m
@Anish Nair by completed segment you mean segment flushed to disk, or moved from real-time table to offline table using managed offline flow? If latter, then upsert won’t work for hybrid tables. If former, who is moving the segment to a separate server?
a
I used the following table config, Table Config: "tenants": {       "broker": "DefaultTenant",       "server": "DefaultTenant",       "tagOverrideConfig": {         "realtimeConsuming": "DefaultTenant_REALTIME",        "realtimeCompleted": "DefaultTenant_OFFLINE"       }     },
i had tagged server1 as DefaultTenant_OFFLINE and server2 as DefaultTenant_REALTIME.
does this config, triggered managed flow?
n
This won't trigger managed flow. But afaik, for upserts, the same partition needs to be on the same host. It definitely won't work if you've set override for realtime completed. Not sure if it'll work if you use instance assignment instead
@Jackie @Yupeng Fu will upserts work if consuming and completed are separated using instance assignment config?
y
@Neha Pawar is correct. it wont work if the segments of the same partition are distributed to more than one host
a
So , let's say if we have two partitions in Kafka topic, p1 and p2 . The consuming and completed segments of a partition needs to be in same server. Is my understanding correct?
n
Yes, that is correct
a
Thanks @Neha Pawar @Yupeng Fu. Just one more clarification regarding scaling RT table. let say If i increase the kafka partitions from 2 to 4 , do i need to any activity at pinot level ?
y
you need to rebuild the table, as the key distribution across partitions will change