| Commit message (Collapse) | Author | Age |
| |
|
|
|
|
|
| |
Includes the same fix from the previous commit which stops caching
entities until the inserts are complete.
Updates storeLogLine to take an insert command with the hostnameId
already bound.
|
| |
|
|
|
|
|
|
| |
Now includes the hostnameId, timestamp and optionally error message.
Updates idx_entities_retryinsert to account for details not being NULL.
Also fixes the issue where the entities inserted and rollback would
still be recorded in the entity cache if the access log insert failed.
This would have lead to PK violations later on.
|
| |
|
|
|
|
|
| |
Use of that as a http_verb doesn't actually cause parse failure (whether
it should or not is another matter)
So it's replaced with CAUSEINSERTFAIL in one case (it does cause this)
and in the parse failure test the whole line is ripped out.
|
| |
|
|
|
|
| |
Fix the warnings picked up by the latest clang-tidy.
Add test cases lifted from the bad_lines log.
Add missing support for \b in escaping.
|
| |
|
|
|
|
| |
Splits up the entities by type, updates the access_log foreign keys to
reference the specific table, removes now redundant indices which
existed only for processing removal of bad lines.
|
| |
|
|
|
| |
Should be unique for value and type, they're not just strings, they can
be different things with the same value... Albeit rarely.
|
| |
|
|
|
| |
Includes tests over the errant behaviour.
Didn't match on type and control flow could return multiple rows.
|
| |
|
|
|
| |
2^31 not big enough for large file downloads, bumped to 64bit.
Replace woolly types with specific uintXX_t in scn call.
|
| |
|
|
|
| |
Not actually required, should we need to reference a specific row, we
can use the ctid column.
|
| |
|
|
|
| |
This prevents other instances acting on the same rows in parallel,
potentially duplicating the rows and effort.
|
| |
|
|
|
| |
This is a background job, has been for a while, so we can sanely allow
it to run for as long as is required.
|
| |
|
|
|
|
|
| |
The need to purge rows in request_time order is not necessary (all rows
will be deleted at some point in the process anyway) and is otherwise
extremely expensive. Removing the order by clause is a roughly 300x
speed up.
|
| | |
|
| |
|
|
|
| |
Simply create the transform constexpr and then apply it to any
collection with the restriction of passing it to a function.
|
| |\ |
|
| | |
| |
| |
| | |
This index would be empty under normal conditions.
|
| | |
| |
| |
| |
| | |
Standard sized batch in a transaction, ordered by entity id.
Includes early exit if terminated.
|
| | |
| |
| |
| |
| |
| | |
Entities are reparsed and reinserted, removed on success.
Failure to parse updates the entity type to UnparsableLine.
Failure to insert again updates the detail with the reason.
|
| | |
| |
| |
| | |
Transform view for getting just the hash and record of a stored entity.
|
| |/
|
|
|
|
|
| |
Wraps a templated value and a templated mutex (defaults to shared_mutex)
and provides safe access, locked with either a shared_lock (const value)
or lock_guard (non-const value).
Applies this to existingEntities.
|
| |
|
|
|
|
| |
It's not critical to run to completion during shutdown, we can pick up
where we left off on the next run. This will allow us to bail out
instead of holding up the shutdown process.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
OK, this is on me. future::valid does not tell you if the thread has
completed and the result is ready. It tells you if there is some state
you can get() maybe later. Here we replace those checks with a 0s wait
and a test to see if the status is ready.
The exit steps are updated to reflect this. Calling reset will invoke
the future's destructor, which blocks until the thread is joined as
needed.
This should hopefully address the issue where the main thread would
still block if it attempted to runJobAsNeeded for a job that was still
running.
|
| |
|
|
| |
It's not required; DB insertion occurs only in a background thread now.
|
| |
|
|
|
| |
Deferred policy is not good enough to avoid blocking the main thread...
it would just mean in blocked later and that's not the point here.
|
| |
|
|
| |
Fixes compatibility with PostgreSQL 18 which fails due to ambiguity.
|
| |
|
|
|
|
| |
Removes the need to block the main thread from reading stdin while
performing post curl operation actions, such as updating user agent
details.
|
| |
|
|
|
| |
Performs a check before launching a job thread, rather than just having
it exit immediately.
|
| |
|
|
|
|
|
| |
Improves handling of entity inserts where the entity already exists and
already has detail; does not call the onInsert handler. This avoids
repeatedly fetching UA detail every time the UA is first seen by a
process.
|
| |
|
|
|
| |
When Fields... is more than a single type, returns a tuple of fields,
instead of a single value.
|
| |
|
|
| |
Insertion cost of flat_map too high when map grows large.
|
| |
|
|
|
| |
Ingest is now background only, so don't limit where they're started
from. Adds some unfortunate locking around the curl maps.
|
| |
|
|
| |
This prevents halting reading input during data insertion.
|
| |
|
|
|
| |
Actual ingest is performed by the main process, jobReadParkedLines just
reads the park file and adds it to the queue.
|
| |
|
|
| |
Fixes issue where queuedLines would be accessed from background thread.
|
| |
|
|
| |
Allows safely running finalisation code in the main thread if required.
|
| | |
|
| |
|
|
|
|
|
| |
Limits the number lines inserted per transactions, and the number of
transactions before returning to reading input.
Prevents long running transactions in the case when queued lines has
grown in size.
|
| | |
|
| |
|
|
| |
Purge is now fully request_time based and not hacked around id ranges.
|
| |
|
|
| |
This reverts commit a6d31ff1d8703eae9375b7ec1cd01b323d7e8e6e.
|
| |\ |
|
| | |
| |
| |
| | |
Plays better with apgdiff
|
| | |
| |
| |
| | |
Line insert is only a single operation with no new entities.
|
| | | |
|
| | |
| |
| |
| |
| | |
Entity value is MD5 hashed same as DB unique key, but the id itself is
now taken from the DB primary key which is sequence generated.
|
| | | |
|
| |/
|
|
| |
Or the last errno on failure.
|
| | |
|
| |
|
|
| |
Also logs them on main loop exit.
|
| | |
|