Project

General

Profile

Actions

Architecture #17921

open

improve searching in ruddersysevents for the reports in store run agents

Architecture #17921: improve searching in ruddersysevents for the reports in store run agents

Added by Nicolas CHARLES over 5 years ago. Updated over 1 year ago.

Status:
New
Priority:
N/A
Assignee:
-
Category:
Performance and scalability
Target version:
Effort required:
Name check:
To do
Fix check:
To do
Regression:

Description

for the moment, we are doing a

select max(id) as id from RudderSysEvents where id > ${fromId} and executionTimeStamp < before

which is widly inefficient (see https://issues.rudder.io/issues/11147 )

then we do

select distinct
  T.nodeid, T.executiontimestamp, coalesce(C.keyvalue, '') as nodeconfigid, coalesce(C.iscomplete, false) as complete, T.insertionid
from
  (select nodeid, executiontimestamp, min(id) as insertionid from ruddersysevents where id > ? and id <= ? group by nodeid, executiontimestamp) as T
left join
  (select
    true as iscomplete, nodeid, executiontimestamp, keyvalue
  from
    ruddersysevents where id > ? and id <= ? and
    eventtype = 'control' and
    component = 'end'
  ) as C
on T.nodeid = C.nodeid and T.executiontimestamp = C.executiontimestamp

agent run being out of order, we cannot simply take execution timestamp from last id as min execution time - risk is that the node is in the future, and prevent any compliance from a long time
we could have some heuristics:

  • take the lowest time from the previous batch considered as the min time where to look from (so we need to store that), minus x minutes
  • if the lowest is in the future from current time, take current time -x minutes?
  • and even always ensure that there is a minimum from now to the min

of we could have the rudder-relay storing this information in reportsexecution, and skip the first part altogether, and then updating a table with the information of which runs have been updated, and from there have the webapp catchup on these and compute the compliance


Related issues 3 (3 open0 closed)

Related to Rudder - Architecture #17180: Compliance incorrectly computed with old reports or runs not sent in node chronological orderNewFrançois ARMANDActions
Related to Rudder - Architecture #16830: nodecompliance and nodecompliancelevels don't contain "no answer" reportsNewActions
Related to Rudder - Architecture #15000: While Rudder is fetching changes from the database, it cannot display the compliance for node list NewActions

Updated by Nicolas CHARLES over 5 years ago Actions #1

  • Tracker changed from Bug to Architecture
  • Priority deleted (0)

Note: rudder-relayd could also store the last run for each node, in a new tale, rather than using the infarious

select r.nodeid, r.date, r.nodeconfigid, r.complete, r.insertionid,
                         c.nodeid, c.nodeconfigid, c.begindate, c.enddate, c.configuration
from (
                 select reportsexecution.nodeid, reportsexecution.date, reportsexecution.nodeconfigid, reportsexecution.complete, reportsexecution.insertionid from
                    reportsexecution where (nodeid, insertionid) in (
                      select nodeid, max(insertionid) as insertionid
                        from reportsexecution
                        where complete = true
                        and nodeid in """ ++
              Fragment.const(s"""(values ${nodes.mkString(",")} )""") ++
              fr""" 
                        GROUP BY nodeid
                     )
                  ) as r
left outer join nodeconfigurations as c
                         on r.nodeId = c.nodeid and r.nodeconfigid = c.nodeconfigid
                     

Updated by François ARMAND over 5 years ago Actions #2

  • Related to Architecture #17180: Compliance incorrectly computed with old reports or runs not sent in node chronological order added

Updated by Nicolas CHARLES over 5 years ago Actions #3

  • Related to Architecture #16830: nodecompliance and nodecompliancelevels don't contain "no answer" reports added

Updated by Nicolas CHARLES over 5 years ago Actions #4

  • Related to Architecture #15000: While Rudder is fetching changes from the database, it cannot display the compliance for node list added

Updated by Vincent MEMBRÉ about 5 years ago Actions #5

  • Target version changed from 6.2.0~beta1 to 6.2.0~rc1

Updated by François ARMAND about 5 years ago Actions #6

  • Target version changed from 6.2.0~rc1 to 7.0.0~beta1

Updated by Vincent MEMBRÉ over 4 years ago Actions #7

  • Target version changed from 7.0.0~beta1 to 7.0.0~beta2

Updated by Vincent MEMBRÉ about 4 years ago Actions #8

  • Target version changed from 7.0.0~beta2 to 7.0.0~beta3

Updated by Alexis Mousset about 4 years ago Actions #9

  • Target version changed from 7.0.0~beta3 to 7.1.0~beta1

Updated by Vincent MEMBRÉ almost 4 years ago Actions #10

  • Target version changed from 7.1.0~beta1 to 7.1.0~beta2

Updated by Vincent MEMBRÉ over 3 years ago Actions #11

  • Target version changed from 7.1.0~beta2 to 7.1.0~rc1

Updated by Alexis Mousset over 3 years ago Actions #12

  • Target version changed from 7.1.0~rc1 to 7.2.0~beta1

Updated by Alexis Mousset over 3 years ago Actions #13

  • Target version changed from 7.2.0~beta1 to 7.3.0~beta1

Updated by Vincent MEMBRÉ almost 3 years ago Actions #14

  • Target version changed from 7.3.0~beta1 to 7.3.0~rc1

Updated by Vincent MEMBRÉ almost 3 years ago Actions #15

  • Target version changed from 7.3.0~rc1 to 7.3.0

Updated by Vincent MEMBRÉ over 2 years ago Actions #16

  • Target version changed from 7.3.0 to 7.3.1

Updated by Vincent MEMBRÉ over 2 years ago Actions #17

  • Target version changed from 7.3.1 to 7.3.2

Updated by Vincent MEMBRÉ over 2 years ago Actions #18

  • Target version changed from 7.3.2 to 7.3.3

Updated by Vincent MEMBRÉ over 2 years ago Actions #19

  • Target version changed from 7.3.3 to 7.3.4

Updated by Vincent MEMBRÉ over 2 years ago Actions #20

  • Target version changed from 7.3.4 to 7.3.5

Updated by Alexis Mousset over 2 years ago Actions #21

  • Target version changed from 7.3.5 to 7.3.6

Updated by Vincent MEMBRÉ over 2 years ago Actions #22

  • Target version changed from 7.3.6 to 7.3.7

Updated by Vincent MEMBRÉ about 2 years ago Actions #23

  • Target version changed from 7.3.7 to 7.3.8

Updated by Vincent MEMBRÉ about 2 years ago Actions #24

  • Target version changed from 7.3.8 to 7.3.9

Updated by Vincent MEMBRÉ about 2 years ago Actions #25

  • Target version changed from 7.3.9 to 7.3.10

Updated by Vincent MEMBRÉ about 2 years ago Actions #26

  • Target version changed from 7.3.10 to 7.3.11

Updated by Vincent MEMBRÉ almost 2 years ago Actions #27

  • Target version changed from 7.3.11 to 7.3.12

Updated by Vincent MEMBRÉ almost 2 years ago Actions #28

  • Target version changed from 7.3.12 to 7.3.13

Updated by Vincent MEMBRÉ almost 2 years ago Actions #29

  • Target version changed from 7.3.13 to 7.3.14

Updated by Vincent MEMBRÉ over 1 year ago Actions #30

  • Target version changed from 7.3.14 to 7.3.15

Updated by Vincent MEMBRÉ over 1 year ago Actions #31

  • Target version changed from 7.3.15 to 7.3.16

Updated by Vincent MEMBRÉ over 1 year ago Actions #32

  • Target version changed from 7.3.16 to 7.3.17
Actions

Also available in: PDF Atom