Hi Team , We have upsert table with "enableSnapsh...
# troubleshooting
p
Hi Team , We have upsert table with "enableSnapshot" : true , but still validDocIds are not being snapshotted . The response of
/tables/{tableNameWithType}/validDocIdsMetadata
is empty . Below is the table upsertConfig . Please suggest.
Copy code
"upsertConfig": {
      "mode": "FULL",
      "metadataTTL": 0,
      "dropOutOfOrderRecord": false,
      "enableSnapshot": true,
      "deletedKeysTTL": 0,
      "hashFunction": "NONE",
      "defaultPartialUpsertStrategy": "OVERWRITE",
      "enablePreload": false,
      "consistencyMode": "NONE",
      "upsertViewRefreshIntervalMs": 3000,
      "allowPartialUpsertConsumptionDuringCommit": false
    }
@Xiang Fu @Pratik Tibrewal Please help when able
x
cc: @Xiaobing
x
How many segments being committed in your table now? As the snapshot is only taken for immutable segments when the next new consuming segment starts.
p
Hi @Xiaobing , Yeah there are segments being committed .. around 514 segments spread over 20 partitions. For older segment as all not able to see SNAPSHOT as validDocType
p
Hey @Praneeth G is it a new table or existing table? If existing, did you restart the hosts after applying the configs?
p
Hi @Pratik Tibrewal .. this is existing table and enableSnapshot was false initially .. haven't restarted the hosts
is that mandatory step ?
let me check with restart
p
Yes in case of upsert, if you change upsert-configs, you need to mandatorily follow-up with restarts for the configs to take effect.
p
Hi @Pratik Tibrewal .. I recreated the table (deleted and adding the table back) with "enabledSnapshots" as true and was able to see results SNAPSHOT validDocType as well . But on triggering upsert compaction job , seeing the below error .
Copy code
java.lang.IllegalStateException: 'enableSnapshot' from UpsertConfig must be enabled for UpsertCompactionTask with validDocIdsType = SNAPSHOT at org.apache.pinot.shaded.com.google.common.base.Preconditions.checkState(Preconditions.java:515) at org.apache.pinot.plugin.minion.tasks.upsertcompaction.UpsertCompactionTaskGenerator.generateTasks(UpsertCompactionTaskGenerator.java:157) at
Since this is a recreated table .. is there any caching of table config somewhere that could lead to this ? Do you think this is a bug ? cc : @Xiaobing
p
enableSnapshot
<-- the config is without
s
at the end and no
d
in between. Can you confirm if the config name is correct?
p
Yes @Pratik Tibrewal , it is enableSnapshot .. it was a typo above , my bad.
Copy code
"upsertConfig": {
      "mode": "FULL",
      "metadataTTL": 0,
      "dropOutOfOrderRecord": false,
      "enableSnapshot": true,
      "deletedKeysTTL": 0,
      "hashFunction": "NONE",
      "defaultPartialUpsertStrategy": "OVERWRITE",
      "enablePreload": false,
      "consistencyMode": "NONE",
      "upsertViewRefreshIntervalMs": 3000,
      "allowPartialUpsertConsumptionDuringCommit": false
    }
Basically
enableSnapshot
was false .. instead of restarting the servers ( there are around 10) after making it true .. we recreated the table with
enableSnapshot
: true . ( schema was not deleted , only table ) After the table re-creation ..on segment commit , was able to see results for SNAPSHOT validDocType as well . But upsertCompaction job is failing .
p
can you share your upsertCompaction config too or entire table config if possible?
p
@Pratik Tibrewal .. After restarting controller nodes , the upset compaction job worked . Guess the table config is cached in controller, apart from ZK.
Copy code
{
  "REALTIME": {
    "tableName": "merchant_store_dimension_REALTIME",
    "tableType": "REALTIME",
    "segmentsConfig": {
      "retentionTimeUnit": "DAYS",
      "retentionTimeValue": "90000",
      "replicasPerPartition": "2",
      "timeColumnName": "merchant_acquisition_date_ts",
      "minimizeDataMovement": false
    },
    "tenants": {
      "broker": "DefaultTenant",
      "server": "DefaultTenant"
    },
    "tableIndexConfig": {
      "invertedIndexColumns": [
        "merchant_id",
        "store_id"
      ],
      "noDictionaryColumns": [],
      "streamConfigs": {
        "streamType": "kafka",
        "stream.kafka.topic.name": "merchant_store_dimension",
        "stream.kafka.broker.list": "<broker>",
        "stream.kafka.consumer.type": "lowlevel",
        "stream.kafka.consumer.prop.auto.offset.reset": "smallest",
        "stream.kafka.consumer.factory.class.name": "org.apache.pinot.plugin.stream.kafka20.KafkaConsumerFactory",
        "stream.kafka.decoder.class.name": "org.apache.pinot.plugin.stream.kafka.KafkaJSONMessageDecoder",
        "realtime.segment.flush.threshold.rows": "0",
        "realtime.segment.flush.threshold.time": "1h",
        "realtime.segment.flush.threshold.segment.size": "500M"
      },
      "aggregateMetrics": false,
      "enableDefaultStarTree": false,
      "nullHandlingEnabled": false,
      "bloomFilterColumns": [],
      "onHeapDictionaryColumns": [],
      "rangeIndexColumns": [],
      "sortedColumn": [],
      "varLengthDictionaryColumns": [],
      "rangeIndexVersion": 2,
      "optimizeDictionaryForMetrics": false,
      "optimizeDictionary": false,
      "autoGeneratedInvertedIndex": false,
      "createInvertedIndexDuringSegmentGeneration": false,
      "loadMode": "MMAP",
      "enableDynamicStarTreeCreation": false,
      "columnMajorSegmentBuilderEnabled": true,
      "noDictionarySizeRatioThreshold": 0.85
    },
    "metadata": {},
    "quota": {},
    "task": {
      "taskTypeConfigsMap": {
        "UpsertCompactionTask": {
          "schedule": "0 59 18 * * ?",
          "bufferTimePeriod": "4h",
          "invalidRecordsThresholdPercent": "1",
          "tableMaxNumTasks": "40"
        }
      }
    },
    "routing": {
      "instanceSelectorType": "strictReplicaGroup"
    },
    "query": {},
    "upsertConfig": {
      "mode": "FULL",
      "metadataTTL": 0,
      "dropOutOfOrderRecord": false,
      "enableSnapshot": true,
      "deletedKeysTTL": 0,
      "allowPartialUpsertConsumptionDuringCommit": false,
      "hashFunction": "NONE",
      "defaultPartialUpsertStrategy": "OVERWRITE",
      "enablePreload": false,
      "consistencyMode": "NONE",
      "upsertViewRefreshIntervalMs": 3000
    },
    "ingestionConfig": {
      "transformConfigs": [
        {
          "columnName": "merchant_acquisition_date_ts",
          "transformFunction": "DATETIMECONVERT(merchant_acquisition_date, '1:MILLISECONDS:SIMPLE_DATE_FORMAT:yyyy-MM-dd HH:mm:ss.SSS', '1:MILLISECONDS:EPOCH', '1:SECONDS')"
        }
      ],
      "continueOnError": true,
      "rowTimeValueCheck": false,
      "segmentTimeValueCheck": true
    },
    "isDimTable": false
  }
}