Aditya
02/03/2022, 1:34 PM{"Tags":["TAG1","TAG3", "TAG2"]}
Running query like below :
select sum(amount) as amt from transactions
where from_user_id = 'some id'
and JSON_MATCH(tag, '"$.Tags[*]"=''FD''')
Created sorted index on from_user_id(string) and json index on tag
Explain plan shows both the index are used
The queries take ~500 ms,
Is there a way to improve this? Some obvious optimisation I am missingKishore G
Aditya
02/03/2022, 2:23 PM"numServersQueried": 2,
"numServersResponded": 2,
"numSegmentsQueried": 13,
"numSegmentsProcessed": 13,
"numSegmentsMatched": 13,
"numConsumingSegmentsQueried": 0,
"numDocsScanned": 69,
"numEntriesScannedInFilter": 6,
"numEntriesScannedPostFilter": 69,
"numGroupsLimitReached": false,
"totalDocs": 100000000,
"timeUsedMs": 502,
"offlineThreadCpuTimeNs": 0,
"realtimeThreadCpuTimeNs": 0,
"offlineSystemActivitiesCpuTimeNs": 0,
"realtimeSystemActivitiesCpuTimeNs": 0,
"offlineResponseSerializationCpuTimeNs": 0,
"realtimeResponseSerializationCpuTimeNs": 0,
"offlineTotalCpuTimeNs": 0,
"realtimeTotalCpuTimeNs": 0,Aditya
02/03/2022, 2:27 PMselect sum(amount) as amt from transactions
where from_user_id = 'some id'
and JSON_MATCH(tag, '"$.Tags[*]"=''MF''')
Metadata
"exceptions": [],
"numServersQueried": 2,
"numServersResponded": 2,
"numSegmentsQueried": 13,
"numSegmentsProcessed": 13,
"numSegmentsMatched": 6,
"numConsumingSegmentsQueried": 0,
"numDocsScanned": 10,
"numEntriesScannedInFilter": 2,
"numEntriesScannedPostFilter": 10,
"numGroupsLimitReached": false,
"totalDocs": 100000000,
"timeUsedMs": 158,
"offlineThreadCpuTimeNs": 0,
"realtimeThreadCpuTimeNs": 0,
"offlineSystemActivitiesCpuTimeNs": 0,
"realtimeSystemActivitiesCpuTimeNs": 0,
"offlineResponseSerializationCpuTimeNs": 0,
"realtimeResponseSerializationCpuTimeNs": 0,
"offlineTotalCpuTimeNs": 0,
"realtimeTotalCpuTimeNs": 0,
"segmentStatistics": [],
It matched only 6 segments, makes sense that it was fasterKishore G
Aditya
02/03/2022, 2:44 PMm5x.large ec2 instances * 4
4 cores, 16GB ram
50 GB ssd (Can increase this but still have ample free space)
S3 deep store configured
4 * Brokers and Servers on same ec2 host
1 Controller is hosted along with broker and server in one ec2 host
2 replica groups * 2 hosts eachKishore G
Richard Startin
02/03/2022, 4:32 PMAditya
02/03/2022, 4:53 PMselect count(*) from transactions
where JSON_MATCH(tag, '"$.Tags[*]"=''FD''')
MF : 12466054
select count(*) from transactions
where JSON_MATCH(tag, '"$.Tags[*]"=''MF''')
FD is definitely more frequentRichard Startin
02/03/2022, 5:01 PMRichard Startin
02/03/2022, 5:05 PMAditya
02/03/2022, 5:13 PMJSONPATH(tag, '$.Tags') transforms it to multivalued col, just reloaded all segmentsAditya
02/03/2022, 5:15 PMCaught exception while creating derived column: tags_mv with transform function: JSONPATH(tag, '$.Tags')
java.lang.ClassCastException: nullRichard Startin
02/03/2022, 5:57 PMAditya
02/03/2022, 6:00 PMJSONPATHARRAY(\"tag\", '$.Tags[*]')
albeit reloading segments was hard on servers, 3 out of 4 docker containers restarted
had to restart a server, still one server is not happy
Keeps throwing this error
[BaseServerStarter] [Start a Pinot [SERVER]] Sleep for 10000ms as service status has not turned GOOD: PinotServiceManagerStatusCallback:Started;MultipleCallbackServiceStatusCallback:IdealStateAndCurrentStateMatchServiceStatus
Callback:partition=transactions_OFFLINE_1617235200701_1619827199799_0, expected=ONLINE, found=OFFLINE, creationTime=1643910462990, modifiedTime=1643910639645, version=6, waitingFor=CurrentStateMatch, resource=transactions_OFFLINE, numResourcesLeft=1, num
TotalResources=3, minStartCount=3,;IdealStateAndExternalViewMatchServiceStatusCallback:Init;;Richard Startin
02/03/2022, 6:07 PMAditya
02/03/2022, 6:12 PMAditya
02/03/2022, 6:18 PMJSONPATHARRAY
Results got messed up after first null tagAditya
02/04/2022, 6:58 AM2022/02/04 06:44:19.429 INFO [V3DefaultColumnHandler] [HelixTaskExecutor-message_handle_thread] Starting default column action: ADD_DIMENSION on column: tags_mv
2022/02/04 06:44:22.410 INFO [BaseServerStarter] [Start a Pinot [SERVER]] Sleep for 10000ms as service status has not turned GOOD: MultipleCallbackServiceStatusCallback:IdealStateAndCurrentStateMatchServiceStatusCallback:partition=transactions_OFFLINE_1617235200701_1619827199799_0, expected=ONLINE, found=OFFLINE, creationTime=1643956885876, modifiedTime=1643957050869, version=6, waitingFor=CurrentStateMatch, resource=transactions_OFFLINE, numResourcesLeft=1, numTotalResources=3, minStartCount=3,;IdealStateAndExternalViewMatchServiceStatusCallback:Init;;PinotServiceManagerStatusCallback:Started;
The log ends with this warning
2022/02/04 06:51:37.508 WARN [BaseServerStarter] [Start a Pinot [SERVER]] Service status has not turned GOOD within 585408ms: MultipleCallbackServiceStatusCallback:IdealStateAndCurrentStateMatchServiceStatusCallback:partition=transactions_OFFLINE_1617235200701_1619827199799_0, expected=ONLINE, found=OFFLINE, creationTime=1643956885876, modifiedTime=1643957050869, version=6, waitingFor=CurrentStateMatch, resource=transactions_OFFLINE, numResourcesLeft=1, numTotalResources=3, minStartCount=3,;IdealStateAndExternalViewMatchServiceStatusCallback:Init;;PinotServiceManagerStatusCallback:Started;
I had another table its segments loaded successfully.
How can we recover from this state?Aditya
02/04/2022, 7:10 AM2022/02/04 07:03:42.809 WARN [MultiGetRequest] [restapi-multiget-thread-983] Caught 'java.net.SocketTimeoutException: Read timed out' while executing GET on URL: <http://10.9.3.206:8097/table/transcript_OFFLINE/size>
2022/02/04 07:03:42.809 ERROR [CompletionServiceHelper] [grizzly-http-server-0] Connection error
java.util.concurrent.ExecutionException: java.net.SocketTimeoutException: Read timed out
Its now declared dead in pinot ui (was alive for some time)Aditya
02/04/2022, 7:21 AMmanual-pinot-server-3 | 2022/02/04 06:52:34.274 ERROR [StartServiceManagerCommand] [Start a Pinot [SERVER]] Failed to start a Pinot [SERVER] at 671.903 since launch
manual-pinot-server-3 | org.apache.helix.HelixException: fail to set config. cluster: defaultpinot is NOT setup.
says cluster not setup, the name is correct and other 3 servers are connecting to defaultpinot clusterAditya
02/04/2022, 7:34 AMAditya
02/04/2022, 8:03 AM[431.180s][info][gc] GC(227) Pause Young (Concurrent Start) (G1 Evacuation Pause) 4088M->4088M(4096M) 12.911ms
[431.180s][info][gc] GC(229) Concurrent Cycle
[436.696s][info][gc] GC(228) Pause Full (G1 Evacuation Pause) 4088M->4073M(4096M) 5515.255ms
[436.700s][info][gc] GC(229) Concurrent Cycle 5519.263ms
[436.714s][info][gc] GC(230) To-space exhausted
xmx 6G
[263.348s][info][gc] GC(151) Pause Young (Normal) (G1 Evacuation Pause) 6138M->6138M(6144M) 131.588ms
[271.732s][info][gc] GC(152) Pause Full (G1 Evacuation Pause) 6138M->5922M(6144M) 8383.175ms
[271.936s][info][gc] GC(153) To-space exhausted
[271.937s][info][gc] GC(153) Pause Young (Concurrent Start) (G1 Evacuation Pause) 6136M->6136M(6144M) 125.753ms
[271.937s][info][gc] GC(155) Concurrent Cycle
xmx 8G
[231.592s][info][gc] GC(165) Pause Young (Normal) (G1 Evacuation Pause) 8183M->8183M(8192M) 220.512ms
[242.595s][info][gc] GC(166) Pause Full (G1 Evacuation Pause) 8183M->7819M(8192M) 11002.538ms
[242.595s][info][gc] GC(164) Concurrent Cycle 11426.133ms
[242.943s][info][gc] GC(167) To-space exhausted
no effect of increasing heap sizeRichard Startin
02/04/2022, 8:57 AMRichard Startin
02/04/2022, 8:57 AMAditya
02/04/2022, 8:59 AMAditya
02/04/2022, 9:00 AMAditya
02/04/2022, 9:03 AMAditya
02/04/2022, 9:07 AMjcmd <pid> JFR.start duration=60s settings=profile filename=startup_profile.jfrAditya
02/04/2022, 9:26 AMjcmd 1 JFR.start duration=60s settings=profile filename=startup_profile.jfr
1:
com.sun.tools.attach.AttachNotSupportedException: Unable to open socket file /proc/1/root/tmp/.java_pid1: target process 1 doesn't respond within 10500ms or HotSpot VM not loaded
at jdk.attach/sun.tools.attach.VirtualMachineImpl.<init>(VirtualMachineImpl.java:100)
at jdk.attach/sun.tools.attach.AttachProviderImpl.attachVirtualMachine(AttachProviderImpl.java:58)
at jdk.attach/com.sun.tools.attach.VirtualMachine.attach(VirtualMachine.java:207)
at jdk.jcmd/sun.tools.jcmd.JCmd.executeCommandForPid(JCmd.java:114)Aditya
02/04/2022, 9:26 AMRichard Startin
02/04/2022, 9:38 AM-XX:+FlightRecorder -XX:StartFlightRecording=duration=300s,settings=profile,filename=filename.jfrRichard Startin
02/04/2022, 9:38 AMAditya
02/04/2022, 9:39 AMAditya
02/04/2022, 9:47 AMRichard Startin
02/04/2022, 9:48 AMRichard Startin
02/04/2022, 9:48 AMAditya
02/04/2022, 9:50 AMRichard Startin
02/04/2022, 9:50 AMRichard Startin
02/04/2022, 9:54 AMRichard Startin
02/04/2022, 9:57 AMAditya
02/04/2022, 10:00 AMTo-space exhausted
will share another profile with new imageAditya
02/04/2022, 10:22 AMRichard Startin
02/04/2022, 11:18 AMAditya
02/04/2022, 12:00 PMRichard Startin
02/04/2022, 12:04 PMRichard Startin
02/04/2022, 12:06 PMRichard Startin
02/04/2022, 12:07 PM-XX:+UseMD5IntrinsicsAditya
02/04/2022, 12:08 PMAditya
02/04/2022, 12:08 PM-XX:+UseMD5Intrinsics -> pinot runs on jdk 11 only right
that the jvm in docker imageRichard Startin
02/04/2022, 12:09 PMRichard Startin
02/04/2022, 12:10 PMAditya
02/04/2022, 12:11 PMRichard Startin
02/04/2022, 12:15 PMAditya
02/04/2022, 12:19 PM2022/02/04 06:44:19.429 INFO [V3DefaultColumnHandler] [HelixTaskExecutor-message_handle_thread] Starting default column action: ADD_DIMENSION on column: tags_mv
2022/02/04 06:44:22.410 INFO [BaseServerStarter] [Start a Pinot [SERVER]] Sleep for 10000ms as service status has not turned GOOD: MultipleCallbackServiceStatusCallback:IdealStateAndCurrentStateMatchServiceStatusCallback:partition=transactions_OFFLINE_1617235200701_1619827199799_0, expected=ONLINE, found=OFFLINE, creationTime=1643956885876, modifiedTime=1643957050869, version=6, waitingFor=CurrentStateMatch, resource=transactions_OFFLINE, numResourcesLeft=1, numTotalResources=3, minStartCount=3,;IdealStateAndExternalViewMatchServiceStatusCallback:Init;;PinotServiceManagerStatusCallback:Started;
transform config for tag_mv
{
"columnName": "tags_mv",
"transformFunction": "JSONPATHARRAYDEFAULTEMPTY(\"tag\", '$.Tags[*]')"
}Richard Startin
02/04/2022, 12:22 PMRichard Startin
02/04/2022, 12:23 PMRichard Startin
02/04/2022, 12:23 PMAditya
02/04/2022, 12:28 PMRichard Startin
02/04/2022, 12:30 PMRoaringBitmap in the allocation profileRichard Startin
02/04/2022, 12:31 PMRichard Startin
02/04/2022, 12:32 PMRichard Startin
02/04/2022, 12:33 PMRichard Startin
02/04/2022, 12:34 PMAditya
02/04/2022, 12:34 PMRichard Startin
02/04/2022, 12:38 PMRichard Startin
02/04/2022, 12:38 PMRichard Startin
02/04/2022, 12:40 PMAditya
02/04/2022, 12:40 PMinvertedIndexColumns but I removed it later
Is it default for MV column?Richard Startin
02/04/2022, 1:16 PMAditya
02/04/2022, 1:27 PMAditya
02/04/2022, 1:33 PM