Segments are going into bad state when trying to a...
# troubleshooting
j
Segments are going into bad state when trying to add a segment to offline dim table PINOT Version 1.1.0
Copy code
pinot-server-1  | 2025/01/09 10:16:14.532 ERROR [133_8098 - SegmentOnlineOfflineStateModel] [HelixTaskExecutor-message_handle_thread_21] Caught exception in state transition OFFLINE -> ONLINE for table: trl_config_OFFLINE, segment: trl_config_1736417708151
pinot-server-1  | java.lang.IllegalStateException: Table data manager is already shut down, cannot add/replace segment: trl_config_1736417708151 of table: trl_config_OFFLINE
pinot-server-1  |       at org.apache.pinot.shaded.com.google.common.base.Preconditions.checkState(Preconditions.java:835) ~[pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at org.apache.pinot.core.data.manager.BaseTableDataManager.addOrReplaceSegment(BaseTableDataManager.java:513) ~[pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at org.apache.pinot.server.starter.helix.HelixInstanceDataManager.addOrReplaceSegment(HelixInstanceDataManager.java:517) ~[pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at org.apache.pinot.server.starter.helix.SegmentOnlineOfflineStateModelFactory$SegmentOnlineOfflineStateModel.onBecomeOnlineFromOffline(SegmentOnlineOfflineStateModelFactory.java:201) [pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
pinot-server-1  |       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
pinot-server-1  |       at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
pinot-server-1  |       at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
pinot-server-1  |       at org.apache.helix.messaging.handling.HelixStateTransitionHandler.invoke(HelixStateTransitionHandler.java:350) [pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at org.apache.helix.messaging.handling.HelixStateTransitionHandler.handleMessage(HelixStateTransitionHandler.java:278) [pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at org.apache.helix.messaging.handling.HelixTask.call(HelixTask.java:97) [pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at org.apache.helix.messaging.handling.HelixTask.call(HelixTask.java:49) [pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
pinot-server-1  |       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
pinot-server-1  |       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
pinot-server-1  |       at java.base/java.lang.Thread.run(Thread.java:829) [?:?]
pinot-server-1  | 2025/01/09 10:16:14.540 ERROR [HelixStateTransitionHandler] [HelixTaskExecutor-message_handle_thread_21] Exception while executing a state transition task trl_config_1736417708151
pinot-server-1  | java.lang.reflect.InvocationTargetException: null
pinot-server-1  |       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
pinot-server-1  |       at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
pinot-server-1  |       at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
pinot-server-1  |       at java.base/java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
pinot-server-1  |       at org.apache.helix.messaging.handling.HelixStateTransitionHandler.invoke(HelixStateTransitionHandler.java:350) ~[pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at org.apache.helix.messaging.handling.HelixStateTransitionHandler.handleMessage(HelixStateTransitionHandler.java:278) [pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at org.apache.helix.messaging.handling.HelixTask.call(HelixTask.java:97) [pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at org.apache.helix.messaging.handling.HelixTask.call(HelixTask.java:49) [pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
pinot-server-1  |       at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
pinot-server-1  |       at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
pinot-server-1  |       at java.base/java.lang.Thread.run(Thread.java:829) [?:?]
pinot-server-1  | Caused by: java.lang.IllegalStateException: Table data manager is already shut down, cannot add/replace segment: trl_config_1736417708151 of table: trl_config_OFFLINE
pinot-server-1  |       at org.apache.pinot.shaded.com.google.common.base.Preconditions.checkState(Preconditions.java:835) ~[pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at org.apache.pinot.core.data.manager.BaseTableDataManager.addOrReplaceSegment(BaseTableDataManager.java:513) ~[pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at org.apache.pinot.server.starter.helix.HelixInstanceDataManager.addOrReplaceSegment(HelixInstanceDataManager.java:517) ~[pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       at org.apache.pinot.server.starter.helix.SegmentOnlineOfflineStateModelFactory$SegmentOnlineOfflineStateModel.onBecomeOnlineFromOffline(SegmentOnlineOfflineStateModelFactory.java:201) ~[pinot-all-1.1.0-jar-with-dependencies.jar:1.1.0-c2606742bbc4b15cff857eb0ffe7ec878ff181bb]
pinot-server-1  |       ... 12 more
pinot-server-1  | 2025/01/09 10:16:14.542 ERROR [StateModel] [HelixTaskExecutor-message_handle_thread_21] Default rollback method invoked on error. Error Code: ERROR
pinot-server-1  | 2025/01/09 10:16:14.547 ERROR [HelixTask] [HelixTaskExecutor-message_handle_thread_21] Message execution failed. msgId: 2b3eb3d4-5d6d-4352-9763-3d0ca1084b56, errorMsg: java.lang.reflect.InvocationTargetException
pinot-server-1  | 2025/01/09 10:16:14.554 ERROR [HelixStateTransitionHandler] [HelixTaskExecutor-message_handle_thread_21] Skip internal error. errCode: ERROR, errMsg: null
Table config
Copy code
{
  "tableName": "trl_config_OFFLINE",
  "tableType": "OFFLINE",
  "segmentsConfig": {
    "replication": "1",
    "minimizeDataMovement": false,
    "segmentPushType": "REFRESH",
    "segmentPushFrequency": "DAILY",
    "schemaName": "trl_config"
  },
  "tenants": {
    "broker": "DefaultTenant",
    "server": "DefaultTenant"
  },
  "tableIndexConfig": {
    "columnMajorSegmentBuilderEnabled": false,
    "invertedIndexColumns": [],
    "noDictionaryColumns": [],
    "rangeIndexColumns": [],
    "rangeIndexVersion": 2,
    "autoGeneratedInvertedIndex": false,
    "createInvertedIndexDuringSegmentGeneration": false,
    "sortedColumn": [],
    "bloomFilterColumns": [],
    "loadMode": "MMAP",
    "onHeapDictionaryColumns": [],
    "varLengthDictionaryColumns": [],
    "enableDefaultStarTree": false,
    "enableDynamicStarTreeCreation": false,
    "aggregateMetrics": false,
    "nullHandlingEnabled": false,
    "optimizeDictionary": false,
    "optimizeDictionaryForMetrics": false,
    "noDictionarySizeRatioThreshold": 0.85
  },
  "metadata": {},
  "quota": {
    "storage": "200M"
  },
  "routing": {},
  "query": {},
  "ingestionConfig": {
    "batchIngestionConfig": {
      "segmentIngestionType": "REFRESH",
      "segmentIngestionFrequency": "DAILY",
      "consistentDataPush": false
    },
    "continueOnError": true,
    "rowTimeValueCheck": true,
    "segmentTimeValueCheck": false
  },
  "isDimTable": true
}
Table schema
Copy code
{
  "schemaName": "trl_config",
  "enableColumnBasedNullHandling": false,
  "dimensionFieldSpecs": [
    {
      "name": "trl_Code",
      "dataType": "STRING",
      "notNull": true
    },
    {
      "name": "trl_Descriptionn",
      "dataType": "STRING",
      "notNull": true
    },
    {
      "name": "txnGrouping",
      "dataType": "STRING",
      "notNull": true
    }
  ],
  "primaryKeyColumns": [
    "trl_Code"
  ]
}
Curl call to add the file to table
Copy code
curl --location --globoff 'http://ip:9000/ingestFromFile?tableNameWithType=trl_config_OFFLINE&batchConfigMapStr={%22inputFormat%22%3A%22json%22}' \
--header 'Content-Type: multipart/form-data' \
--header 'Authorization: {{apiKey}}' \
--form 'file=@"/Downloads/data.json"'

Response 
{
    "status": "Successfully ingested file into table: trl_config_OFFLINE as segment: trl_config_1736418276820"
}
cc @Xiang Fu @Rajat Venkatesh
java.lang.IllegalStateException: Table data manager is already shut down, cannot add/replace segment: trl_config_1736417708151 of table: trl_config_OFFLINE
r
did you delete and recreate the table ?
j
Yes
r
the table was recreated too fast. delete cmd takes some time to propogate to all servers.
j
Oh okay
Let me retry then
r
so you created the table while the cmd was being propogated
j
So should I delete the table and create it few mins later now?
r
yes.
j
I created the same table with a different name it works. I have waited for like 2 mins but still unable to create the table with the same name. Is there any manual cleanup that i can do?
r
no. not that I am aware of.
x
how large is the dim table size like number of segments? Also which version are you running, we had a recent fix for this for fast table recreation
j
It’s a small segment having around 2k records Currently running 1.1.0
x
ok, then likely it’s fixed already in newer versions
j
@Xiang Fu how can I fix my situation with version 1.1.0 its been more than an hour since the table was deleted and its still giving the same error.
x
What I can think of is to rolling restart all the servers
j
thank you @Xiang Fu & @Rajat Venkatesh doing a rolling restart helped