apache / druid

Apache Druid: a high performance real-time analytics database.
https://druid.apache.org/
Apache License 2.0
13.5k stars 3.7k forks source link

Druid jdbc lookups: why poll period isn't working? #11868

Open ghost opened 3 years ago

ghost commented 3 years ago

Hey, I created a lookup and was hoping that it will update within given time range But actually it's not (data remains the same )

Here is what specified in the config.


{
  "type": "cachedNamespace",
  "extractionNamespace": {
    "type": "jdbc",
    "connectorConfig": {
      "connectURI": "someuri",
      "user": "someuser",
      "password": "somepass"
    },
    "table": "sometable",
    "keyColumn": "somekey",
    "valueColumn": "somevalue",
    "filters": "not thing_name is null"
  },
  "firstCacheTimeout": 0,
  "pollPeriod": "PT5M",
  "injective": true
}

Also I tried to create a lookup from example located here

It looks like

{
  "type": "pollingLookup",
  "pollPeriod": "PT10M",
  "dataFetcher": {
    "type": "jdbcDataFetcher",
    "connectorConfig": "someuri",
    "table": "sometable",
    "keyColumn": "somekey",
    "valueColumn": "somevalue"
  },
  "cacheFactory": {
    "type": "onHeapPolling"
  }
} 

First config is creating a lookup which is not updating Second one (straight from the docs) doesn't appear in the lookup schema at all (telling that this lookup does not exist)

Can someone help and answer what is missing?

igorvpcleao commented 3 years ago

Hey @EgorEna, First things first, I'm just someone with moderate knowledge trying to help, not a Druid expert here.

By focusing on your first spec, do you see something like this when you look at your historical node logs?

2021-11-03T20:37:49,917 INFO [NamespaceExtractionCacheManager-1] org.apache.druid.server.lookup.namespace.JdbcCacheGenerator - Finished loading 2990136 values for namespace [JdbcExtractionNamespace{connectorConfig=DbConnectorConfig{createTables=false, connectURI='jdbc:mysql://REDACTED:3306/something?user='REDACTED', passwordProvider=org.apache.druid.metadata.DefaultPasswordProvider, dbcpProperties=null}, table='REDACTED', keyColumn='id', valueColumn='type', tsColumn='updated_at', filter='null', pollPeriod=P1D}] : org.apache.druid.server.lookup.namespace.cache.CacheScheduler$EntryImpl@22e17b56
  1. I'd like to make sure that you're able to see a Finished loading x values message recently (or at least see an exception while loading it).
  2. Also, does "injective": true really applies to you? It should only be used when both keys and values are unique.
  3. Finally, by not updating you mean changing existing values, or not deleting entries that were previously deleted from your database?