Hi Team , For one of our table the older segments ...
# troubleshooting
a
Hi Team , For one of our table the older segments are not getting deleted. The TTL is of 30 days but the data is still there for beyond (100 days). The table ingestion is going good and able to serve queries correctly too. Segments status is good too for All. Although there are few observations : 1. private void manageRetentionForRealtimeTable(String realtimeTableName, RetentionStrategy retentionStrategy) { 2. List<String> segmentsToDelete = new ArrayList<>(); 3. IdealState idealState = _pinotHelixResourceManager.getHelixAdmin() 4. .getResourceIdealState(_pinotHelixResourceManager.getHelixClusterName(), realtimeTableName); 5. for (SegmentZKMetadata segmentZKMetadata : _pinotHelixResourceManager.getSegmentsZKMetadata(realtimeTableName)) { 6. String segmentName = segmentZKMetadata.getSegmentName(); 7. if (segmentZKMetadata.getStatus() == Status.IN_PROGRESS) { 8. // Delete old LLC segment that hangs around. Do not delete segment that are current since there may be a race 9. // with RealtimeSegmentValidationManager trying to auto-create the LLC segment 10. if (shouldDeleteInProgressLLCSegment(segmentName, idealState, segmentZKMetadata)) { 11. segmentsToDelete.add(segmentName); 12. } 13. } else { 14. // Sealed segment 15. if (retentionStrategy.isPurgeable(realtimeTableName, segmentZKMetadata)) { 16. segmentsToDelete.add(segmentName); 17. } 18. } 19. }
Copy code
_pinotHelixResourceManager.getSegmentsZKMetadata(realtimeTableName))
For some reason the segment path is not there under segments. But I can see the metadata under External View. For all the other tables I can see ZK metadata is present in both the places. Controller logs : 2025-02-07T095652.630692061Z stdout F ZKPath /PinotCluster/PROPERTYSTORE/SEGMENTS/amxordersntt_REALTIME/533/code/code/code/code/code does not exist
m
Retention is based on time column, not when segment was created. Can you check the min and max time in the segment? You can refer to it in the query: “where $segmentName = xxx”
a
Yes Mayank - I know that and the time column is correct. Check the issue I created it has more details : https://github.com/apache/pinot/issues/15011 The issue is when controller is trying to verify whether the segment is older than the given TTL - it is unable to find the metadata in zk and hence deletion not happening. I am curious on what exactly corrupted the metadata of the segments . Check the screenshots
@Jackie @Xiang Fu Any help here ?
x
this is weird, the segment name is wrong in the segment metadata path, the segment name should be this:
a
Right - And that is why it is not able to delete the data
x
my feeling is that when retention manager ran, it tried to delete the segment, and only deleted the segment metadata but not from the IdealState.
how many segments in your table, does Idealstate size exceed 1MB?
a
It doesnt have any correct segmnet info-
30k segments -
x
you mean all the segment metadata are gone ?
a
does Idealstate size exceed 1MB? - If this happens will it mess up all the existing metadata too ?
yes
x
no, it will fail only idealstate update ,but shouldn’t impact segment metadata
a
But only for this table
x
hmm, can you check property store table config znode metadata
what’s the znode creation time
can you expand the
PROPERTYSTORE/SEGMENTS
for that table
Suggest to follow this doc to increase the znode size first, then restart the whole cluster: https://docs.pinot.apache.org/reference/troubleshooting/troubleshoot-zookeeper#adjust-zookeeper-znode-size
a
You mean this
x
yes, what’s the node metadata
a
image.png
x
ok, then suggest to do the above change for zk first
a
Have updated the zk - Will restart the servers in the evening - Off peak hours
Let me know if an long running reload job can cause this ?
https://github.com/apache/pinot/issues/15011 I have posted the issue here too
x
reload shouldn’t cause this
However we observed the issue that reload a large table may take very long time, it’s the reload job not finished
a
No - Its been running since september - Also I restarted one of the serves - But it still didnt reflected in the zkmetadata
image.png
Zk is updated though
What else do you suspect @Xiang Fu ?
x
hmm. this timeElaspedInMinutes is just the value from the previous finish time. It doesn’t mean the reload is not finished right
have you restarted controller?
a
Aah then its get more confusing on why this is happening.
x
with larger jute buffer size?
a
No - I restarted one of the server
x
my feeling is zk browser cannot load the znode because its too large
can you try to restart controller
with larger jute buffer
a
Doing it now
Controller restart didnt fixed it
Its a meta data issue only - As data is not getting purged
Copy code
2025-02-10T11:25:18.882951588Z stdout F java.io.IOException: Packet len 1270330 is out of range!
These errors are still there in controller logs
x
have you changed jutebuffer in controller jvm args
this means your setting doesn’t apply
a
Checking why this doesnt get applied
x
you need to apply this to all pinot components
add
-Djute.maxbuffer=4000000
to controller/brokers/server/minion as well
a
Ohh - Let me add it then
Seems to coming fine now.
Thanks a lot @Xiang Fu - You are the savior apache pinot crimson
x
👍
I think we should also increase the default value for jute buffer nowadays as well
a
It will have performance implications?
x
Yes, but not on query path. ZK is on cluster and data management path.