Contention refers to a transaction vying for control of a document or index but that keep changing.
In this topic, I go through a step-by-step scenario of contention.
It looks like you are reading a document and trying to update it with a new value (increment it by 1). If there are too many requests made simultaneously then that will most assuredly cause contention.
Speaking of FQL v10, you might find a query like this easier to read. It will still have the same issue with contention, though.
// v10
let logMeta = log_meta.all().first()!
let doc = actions.by_id(${id}) // assuming new v10 index added to `actions` collection.
if (doc.exists()) {
abort("That ID already exists")
}
logMeta.update({ last_added: logMeta.last_added + 1 })
actions.create(${entry})