Hi Team, Can I enable dedup to an already existin...
# troubleshooting
s
Hi Team, Can I enable dedup to an already existing table? My dedup is not working, how can I debug further? I am using below configs: Schema:
Copy code
{
...
"primaryKeyColumns": ["leaderboard_id", "participant_id", "attempt_number"]
...
}
Table:
Copy code
{
...
"routing": {
  "instanceSelectorType": "strictReplicaGroup"
},
"dedupConfig": {
  "dedupEnabled": true,
  "hashFunction": "NONE",
  "dedupTimeColumn": "insertion_time",
  "metadataTTL": 600000,
  "enablePreload": false
}
...
}
Can someone please help here? @Mayank
@Xiang Fu @harnoor Can you please help here?
h
config looks correct. Can you check server logs and specifically logs from
DedupMetadataManager
The input stream is partitioned by the primary key right?
s
Yes, input stream is partitioned (though there is only one partition as of now) I'll check server logs but as far as I remember, there were no logs containing "dedup" substring but I'll check again. Thanks for the response.
Still can't see any log related to dedup. Below are the last logs after pushing data in Kafka: Server-0
Copy code
[Feb 08 2025 15:41:36 GMT+0530] pinot-server-0: 2025/02/08 10:11:36.470 INFO [KafkaConsumer] [leaderboard_entries__0__5__20250208T0942Z] [Consumer clientId=leaderboard_entries_REALTIME-leaderboard-entry-0, groupId=null] Seeking to offset 341 for partition leaderboard-entry-0
[Feb 08 2025 15:41:44 GMT+0530] pinot-server-0: 2025/02/08 10:11:44.301 INFO [ServerQueryLogger] [pqr-0] Processed requestId=1564143934000000072,table=leaderboard_entries_REALTIME,segments(queried/processed/matched/consumingQueried/consumingProcessed/consumingMatched/invalid/limit/value)=4/4/4/1/0/0/0/0/0,schedulerWaitMs=5,reqDeserMs=27,totalExecMs=19,resSerMs=13,totalTimeMs=65,minConsumingFreshnessMs=1739009501264,broker=Broker_pinot-broker-0.pinot-broker-headless.pinot-stage.svc.cluster.local_8099,numDocsScanned=196,scanInFilter=0,scanPostFilter=0,sched=FCFS,threadCpuTimeNs(total/thread/sysActivity/resSer)=0/0/0/0
[Feb 08 2025 15:41:46 GMT+0530] pinot-server-0: 2025/02/08 10:11:46.386 INFO [RealtimeSegmentDataManager_leaderboard_entries__0__5__20250208T0942Z] [leaderboard_entries__0__5__20250208T0942Z] Consumed 1 events from (rate:0.016385652/s), currentOffset=342, numRowsConsumedSoFar=3, numRowsIndexedSoFar=3
[Feb 08 2025 15:41:53 GMT+0530] pinot-server-0: 2025/02/08 10:11:53.424 INFO [ServerQueryLogger] [pqr-1] Processed requestId=1564143934000000074,table=leaderboard_entries_REALTIME,segments(queried/processed/matched/consumingQueried/consumingProcessed/consumingMatched/invalid/limit/value)=4/4/4/1/0/0/0/0/0,schedulerWaitMs=1,reqDeserMs=0,totalExecMs=1,resSerMs=0,totalTimeMs=2,minConsumingFreshnessMs=1739009510094,broker=Broker_pinot-broker-0.pinot-broker-headless.pinot-stage.svc.cluster.local_8099,numDocsScanned=197,scanInFilter=0,scanPostFilter=0,sched=FCFS,threadCpuTimeNs(total/thread/sysActivity/resSer)=0/0/0/0
[Feb 08 2025 15:42:51 GMT+0530] pinot-server-0: 2025/02/08 10:12:51.217 INFO [RealtimeSegmentDataManager_leaderboard_entries__0__5__20250208T0942Z] [leaderboard_entries__0__5__20250208T0942Z] Consumed 1 events from (rate:0.01542472/s), currentOffset=343, numRowsConsumedSoFar=4, numRowsIndexedSoFar=4
Server-1
Copy code
[Feb 08 2025 15:41:41 GMT+0530] pinot-server-1: 2025/02/08 10:11:41.298 INFO [KafkaConsumer] [leaderboard_entries__0__5__20250208T0942Z] [Consumer clientId=leaderboard_entries_REALTIME-leaderboard-entry-0, groupId=null] Seeking to offset 341 for partition leaderboard-entry-0
[Feb 08 2025 15:41:52 GMT+0530] pinot-server-1: 2025/02/08 10:11:52.480 INFO [ServerQueryLogger] [pqr-0] Processed requestId=1564143934000000073,table=leaderboard_entries_REALTIME,segments(queried/processed/matched/consumingQueried/consumingProcessed/consumingMatched/invalid/limit/value)=4/4/4/1/0/0/0/0/0,schedulerWaitMs=4,reqDeserMs=26,totalExecMs=14,resSerMs=10,totalTimeMs=55,minConsumingFreshnessMs=1739009510094,broker=Broker_pinot-broker-0.pinot-broker-headless.pinot-stage.svc.cluster.local_8099,numDocsScanned=197,scanInFilter=0,scanPostFilter=0,sched=FCFS,threadCpuTimeNs(total/thread/sysActivity/resSer)=0/0/0/0
[Feb 08 2025 15:42:20 GMT+0530] pinot-server-1: 2025/02/08 10:12:20.613 INFO [RealtimeSegmentDataManager_leaderboard_entries__0__5__20250208T0942Z] [leaderboard_entries__0__5__20250208T0942Z] Consumed 2 events from (rate:0.030800505/s), currentOffset=343, numRowsConsumedSoFar=4, numRowsIndexedSoFar=4
Do I need to restart pods?
I've tried restarting server pods as well
Seems like both the servers are consuming same event and not deduping as well
h
If dedup is enabled, there will be logs like
Creating TableDedupMetadataManager
or
Creating ConcurrentMapTableDedupMetadataManager
.
Do I need to restart pods
Yes. It needs restart OR should have dedup config from the beginning in table config. It's strange you are not getting any logs even after restarting.
s
I again restarted the pod and got these logs while server was getting up but no dedup related logs while pushing data in Kafka? Any idea how can I debug further?
Copy code
[Feb 09 2025 17:23:20 GMT+0530] pinot-server-1: 2025/02/09 11:53:20.306 INFO [TableDedupMetadataManagerFactory] [HelixTaskExecutor-message_handle_thread_0] Creating ConcurrentMapTableDedupMetadataManager for table: leaderboard_entries_REALTIME
[Feb 09 2025 17:23:20 GMT+0530] pinot-server-1: 2025/02/09 11:53:20.308 INFO [BaseTableDedupMetadataManager] [HelixTaskExecutor-message_handle_thread_0] Initialized ConcurrentMapTableDedupMetadataManager for table: leaderboard_entries_REALTIME with primary key columns: [leaderboard_id, participant_id, attempt_number], hash function: NONE, enable preload: true, metadata TTL: 600000.0, dedup time column: insertion_time, table index dir: /var/pinot/server/data/index/leaderboard_entries_REALTIME
[Feb 09 2025 17:23:20 GMT+0530] pinot-server-1: 2025/02/09 11:53:20.400 INFO [WatermarkUtils] [HelixTaskExecutor-message_handle_thread_0] Loaded watermark: 1.73903387605E12 from file: /var/pinot/server/data/index/leaderboard_entries_REALTIME/ttl.watermark.partition.0.dedup
[Feb 09 2025 17:23:21 GMT+0530] pinot-server-1: 2025/02/09 11:53:21.015 INFO [WatermarkUtils] [leaderboard_entries__0__0__20250209T1024Z] Persisted watermark: 1.73903387605E12 to file: /var/pinot/server/data/index/leaderboard_entries_REALTIME/ttl.watermark.partition.0.dedup
I think I've found the error, I was inserting data with time column value being past than the dedup period. I think the dedup primary key is generated only if the time column value is within the dedup config and then the dedup gets applied without taking the time column value in account.
h
Yes. The TTL should be set long enough else dedup won't happen. refer: https://docs.pinot.apache.org/basics/data-import/dedup#metadata-ttl There will be dedup related metrics emitted by the server if dedup happens. You can refer it as well.
Let me know if you are still facing problem after increasing the TTL.
s
TTL was not the problem but the
insertion_time
was. Though I am adding a new row now at time
T
and my TTL is
10 minutes
but the value of
insertion_time
column in that row is before
T
or
T-10m
so that data is inserted without dedup and primary key data for dedup is also not created because I am able to insert multiple rows with same PK and
insertion_time
older than
T-10m
. But when I insert data which has
insertion_time
after
T-10m
now the PK is created for dedup and when I add the data with same PK, it gets deduped irrespective of the
insertion_time
column value in new row. I don't know if it's intended or not. CC: @Mayank @Xiang Fu