-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 10.10-HF62, 2021.21
-
Component/s: Audit
-
Tags:
-
Backlog priority:900
-
Upgrade notes:
-
Team:PLATFORM
-
Sprint:nxplatform #62
When a user login from the UI there is a call to CMIS to get the server version and other information like the repository name and the latestChangeLogToken.
The lastChangedToken is taken from the audit on elastic this translate to:
curl -H 'Content-Type: application/json' -XGET "<ELASTIC_NODE_URL>/nuxeo-audit/_search?typed_keys=true&ignore_unavailable=false&expand_wildcards=open&allow_no_indices=true&search_type=dfs_query_then_fetch&batched_reduce_size=512" -d '{"from":0,"size":1,"profile": true, "query":{"constant_score":{"filter":{"bool":{"must":[{"term":{"repositoryId":{"value":"default","boost":1.0}}},{"terms":{"eventId":["documentCreated","documentModified","documentRemoved"],"boost":1.0}}],"adjust_pure_negative":true,"boost":1.0}},"boost":1.0}},"sort":[{"id":{"order":"desc"}}]}'
This query cannot scale, because it matches almost all log entries related to documents and it should be sorted,
even if we return only one result there is an aggregation to estimate the total hits with a cost proportional to the number of matches.
It has been observed that with a billion of log entries related to documents it takes a few seconds to complete.