I have a realtime table ingesting from Kafka and a...
# troubleshooting
d
I have a realtime table ingesting from Kafka and an application that writes events to the appropriate Kafka topic. My table originally had
realtime.segment.flush.threshold.rows=30
, and I ran my application to the point where I had pushed around 100k rows to a kafka topic before realizing that this was much too small a segment size. I stopped my app, deleted the table, changed
realtime.segment.flush.threshold.rows=100000
, and recreated it. Then, I ran my app to push 3mil rows to the kafka topic. At some point in Pinot's ingestion process, the status of my table changed to
BAD
. I looked in the controller logs and noticed this error:
Copy code
2021/09/02 16:02:48.585 ERROR [SegmentCompletionFSM_simplejson__0__632__20210902T1602Z] [grizzly-http-server-21] Caught exception while committing segment metadata for segment: simplejson__0__632__20210902T1602Z

java.lang.IllegalStateException: Failed to find IdealState for table: simplejson_REALTIME
In the web UI for the Pinot Controller, under the Cluster Manager for the affected table, I sorted the
SEGMENTS
list by Status and noticed that I had two
Bad
segments. Inspecting the bad segments, I noticed that each had a total of 30 documents. I checked a handful of
Good
segments, and each had 100k documents. I'm not sure how to bring these segments into a
Good
state, or why they entered into a
Bad
state in the first place. I was unable to find anything in Pinot's documentation on what causes this error or how to resolve it.
j
The exception posted here seems a transient ZK issue.
I suspect the issue to be that the segments are not properly cleaned up when deleting the table
Can you please check the ideal state of the table and see if the old segments are still there? Did the table deletion succeed?
d
How can I do that?
As far as whether or not the deletion succeeded, I deleted the table through the WebUI and did not see any errors after doing so
j
If it is okay, can you try deleting the table again and let's check if the segments are cleaned up properly
As the source of truth, you may use zookeeper browser to check if the segments are cleaned up from the cluster
d
I deleted the table and
PinotCluster/PropertyStore/Segments
is reported empty from the zookeeper browser
j
How about the IdealState? It should also be empty
If so, we can go ahead and recreate the table, and it should create segments from sequenceId 0 (e.g.
simplejson__0__0__20210902T...
)
d
PinotCluster/IdealStates has two entries: • brokerResource • leadControllerResource I'm not sure what the entries should have inside them. Forgive my ignorance šŸ˜…
j
That is normal. The entry for the table
simplejson__REALTIME
is removed
d
Yes it is
I'll recreate
j
After recreating the table, the idealstate should show up with the initial consuming segments
d
That is right. I see that now.
Should the table begin consuming from the first offset? The ideal state still shows
CONSUMING
, but I would have expected at least one segment to have completed by now
j
In the table config, did you set the
"stream.kafka.consumer.prop.auto.offset.reset"
to be
"smallest"
?
d
Ah ha, I did not. I assume the default is
largest
Thank you again for your help. I'll be sure to give all the configuration settings a closer read through.
šŸ‘ 1