Project

General

Profile

Bug #10171

If the Rudder Web Interface is interrupted during the second step of reports archiving, then it won't never succeed in archiving again

Added by Nicolas CHARLES 10 months ago. Updated 9 months ago.

Status:
Released
Priority:
N/A
Category:
Web - Maintenance
Target version:
Target version (plugin):
Severity:
User visibility:
Effort required:
Priority:

Description

Reports archiving happens by default every day.
It's a 3 steps procedure, with:
  1. reports insertion into archivedruddersysevents from ruddersysevents
  2. deletion from ruddersysevents
  3. vaccuum

If this is interupted during step 2, then reports already moved will not be deleted, and on the following day they won't be archived (because of duplicate keys)
We should have a more robust system that would recover from where it stopped

(alternatives are to drop the unicity constraints on archivedruddersysevents, but this would lead to duplicate entries in this case)


Subtasks

Bug #10188: Spurious println introduced in parent ticketReleasedFrançois ARMAND


Related issues

Duplicated by Rudder - Bug #3917: Archiving reports should not break on on duplicate IDs or key Rejected

Associated revisions

Revision 43cab768
Added by Nicolas CHARLES 10 months ago

Fixes #10171: If the Rudder Web Interface is interrupted during the second step of reports archiving, then it won't never succeed in archiving again

History

#1 Updated by Nicolas CHARLES 10 months ago

  • Status changed from New to In progress
  • Assignee set to Nicolas CHARLES

#2 Updated by Nicolas CHARLES 10 months ago

Suggested implementation
  1. get A max id of archivedruddersysevents
  2. get R min id of ruddersysevents
  3. get C max id of ruddersysevents where date < archive date
  4. insert reports from [max(R,A) to C] to archivedruddersysevents
  5. delete reports smaller than C from ruddersysevents

#3 Updated by Nicolas CHARLES 10 months ago

risk is: if insert into ruddersysevents is too long, and web interface is restarted, deletion never occurs, so we may add a delete in 3bis for all overlap

#4 Updated by François ARMAND 10 months ago

Seems good to me.

#5 Updated by Nicolas CHARLES 10 months ago

  • Status changed from In progress to Pending technical review
  • Assignee changed from Nicolas CHARLES to François ARMAND
  • Pull Request set to https://github.com/Normation/rudder/pull/1491

#6 Updated by Nicolas CHARLES 10 months ago

  • Status changed from Pending technical review to Pending release
  • % Done changed from 0 to 100

#7 Updated by Vincent MEMBRÉ 9 months ago

  • Status changed from Pending release to Released

This bug has been fixed in Rudder 3.1.18, 3.2.11, 4.0.3 and 4.1.0~beta3 which were released today.

#8 Updated by François ARMAND 8 months ago

  • Duplicates Bug #3917: Archiving reports should not break on on duplicate IDs or key added

#9 Updated by François ARMAND 8 months ago

  • Duplicates deleted (Bug #3917: Archiving reports should not break on on duplicate IDs or key)

#10 Updated by François ARMAND 8 months ago

  • Duplicated by Bug #3917: Archiving reports should not break on on duplicate IDs or key added

Also available in: Atom PDF