We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some deadlocks are arising at Postgres LastData Sink.
DEADLOCK AGGREGATION-A UPSERT (-id:1,-id:...,-id:N) AGGREGATION-B UPSERT (-id:N,-id:...,-id:1)
Sort aggregations by entity_id (at least) may help to avoid the problem.
NO DEADLOCK AGGREGATION-A UPSERT (-id:1,-id:...,-id:N) AGGREGATION-B UPSERT (-id:1,-id:...,-id:N)
Seems that each aggregation has the form:
{ entity_id: [id1,...idn] attr1: [v1,..vn], ... attrM: [v1,..vn] }
There are multiple INSERT queries followed by a single Commit. We should order each query (by any common criteria).
https://github.com/telefonicaid/fiware-cygnus/blob/master/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/sql/SQLBackendImpl.java#L610
This kind of snippet should make the work:
import java.util.ArrayList; import java.util.Comparator; upsertList.sort(Comparator.comparing(buff -> buff.toString()));
https://www.sololearn.com/compiler-playground/ceuF34hEdPlD
We should also change the attribute order within the query, so Time values, which is no key occurs later:
INSERT INTO watercycle_tank_lastdata (recvTime,fiwareServicePath,entityId,entityType,...)
to
INSERT INTO watercycle_tank_lastdata (entityId,entityType,fiwareServicePath recvTime,...)
fiware-cygnus/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/aggregation/NGSIGenericColumnAggregator.java
Line 50 in aae3eb8
The text was updated successfully, but these errors were encountered:
PR #2199
Sorry, something went wrong.
No branches or pull requests
Some deadlocks are arising at Postgres LastData Sink.
Sort aggregations by entity_id (at least) may help to avoid the problem.
Seems that each aggregation has the form:
There are multiple INSERT queries followed by a single Commit. We should order each query (by any common criteria).
https://github.com/telefonicaid/fiware-cygnus/blob/master/cygnus-common/src/main/java/com/telefonica/iot/cygnus/backends/sql/SQLBackendImpl.java#L610
This kind of snippet should make the work:
https://www.sololearn.com/compiler-playground/ceuF34hEdPlD
We should also change the attribute order within the query, so Time values, which is no key occurs later:
to
fiware-cygnus/cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/aggregation/NGSIGenericColumnAggregator.java
Line 50 in aae3eb8
The text was updated successfully, but these errors were encountered: