This message was deleted.
# troubleshooting
s
This message was deleted.
d
With real time ingestion what’s the default time range? hourly?
a
Yes correct
d
So some of your jobs appeared within the same hourly interval and this is a deal breaker to you? You cannot have it consumed a little later?
a
Yes correct
d
hm… then forceTimeChunkLock = true is the only way. We almost tried it, but we decided that having our hourly job to be consumed slightly later is not a big deal.
or maybe change the time window to be smaller (30 mins or 15 mins)? I am not sure if real time ingestion json allows for that.
a
yes I realize it's the only way, that's why I was asking for people that had some experience using it before I try it in production
e
Depending on how often you are dealing with the late-arriving data, perhaps just adding retry logic to the thing scheduling your append jobs will guarantee eventual success? Additionally, if you are using the new SQL-based batch ingestion for the append, it will use a sharable lock for the batch append jobs. You can have your realtime ingestion also use a sharable lock by setting the context flag
useSharedLock
on your supervisor. This should allow for both jobs to run together in parallel. Note, that you should only go this route if you are using the SQL-based batch ingestion. Trying to use it with the JSON-based native batch ingestion has lots of caveats for when it does and does not work. Note, when you switch your supervisor to use the shared lock, you should pause it and let the realtime tasks drain before starting it back up again with the shared lock. If you just set the config and restart the supervisor, your initial tasks will fail as they won't be able to get a lock because of the previously running tasks.
a
@Eric Tschetter I just tested useSharedLock + SQL-based ingestion on my dev environment and it seems to fit what I need perfectly, thanks a lot! I'm assuming it's not in the documents because of the caveats with other ingestion methods?
e
Yes, that's why it's undocumented. Especially because the specific configuration of things that make it actually work for non-SQL-based ingestion is just too complex for anybody to understand. We have stuff in the works to just eliminate locking for appending altogether, which will eliminate the config and make it "just work" without caveats. So, that's the path forward.
a
great, much appreciated!
e
Something to be aware of with any sort of setup that has a lot of late-arriving data: it's important to eventually compact that data back together. You can do it with auto-compaction or if you. have a scheduler externally, you can schedule things with that. Those jobs can be pre-empted from locks sometimes too and that's okay as long as the scheduling will retry and there's eventually enough of a clearing for things to actually complete.
a
that's actually what lead me to needing to add this data, I'm appending late-arriving events that I'm putting to the side while running re-indexing compactions on the previous day, we receive certain types of events that need to be set to the timestamp that we're passed and they come in frequently, and it's client-facing so we couldn't wait too long to ingest the late data that came in during compaction
I ended up making an airflow job that sets a redis flag for the interval being compacted and the service that writes to kafka checks for that flag when it's a late event and puts it into mysql if the flag exists which is where I'm picking it up with this append
e
oh, is there not a natural delay where the late-arriving stuff would maybe become more rare?
The importance of compaction is usually a "it should be compacted at some point" type of things. So even if there's a 3 or 4 day delay on starting compaction, that could still be not horribad
a
there is but it depends on a bunch of external systems and because this is reporting data being put off to the side, we can't be waiting 1 week+ for it to become visible to the client
e
oh, I wasn't meaning delay the data being released
I was meaning, allow the realtime ingestion to pull in the late-arriving data immediately upon arrival, and setup your auto-compaction to run with a 4 or 5 day delay so that it doesn't even try to compact until it's 4 or 5 days old
then the data is never delayed
and you are just delaying the optimization that comes from compaction
a
well we decided to compact ASAP because we're using range partitioning to limit the amount of data druid uses when our clients use the UI - we're using Turnilo as our frontend and we built in a query filter using cookies to append "where client_id = ?" to every single query they run, so converting from realtime partitions to range partitions has a good amount of benefit for us, especially when it's a client with lower traffic
so it's more about delaying adding extra hardware to support our load than anything else
e
Ahhh, that makes sense
a
but I appreciate all the insight
e
you'll like it when we finish the support for compaction and append at the same time then
a
haha that's music to my ears (eyes?)