Open
Conversation
When the client runs a registration multiple endpoints are called, one of them is the system update while the products of the system are being activated if both endpoints callbacks write to the file, it generates duplicate records We could use the system update only to update the file to be exported to DW but the problem is the information is not complete when the endpoint is invoked, meaning there would be duplicate records using that endpoint information because of how registration works The propose change uses the product activate endpoint to populate the file whenever there is a product activation or upgrade (for example, registration) and system update would populate the file when is invoked outside a registration also This fixes bsc#1258943
jesusbv
commented
Feb 26, 2026
| after_action :export_rmt_data, only: %i[update], if: lambda { | ||
| DataExport.handler.presence && response.successful? && !@system.byos? && | ||
| @system.products.present? | ||
| @system.products.present? && @system.registered_at != @system.last_seen_at |
Collaborator
Author
There was a problem hiding this comment.
this means that if a user runs heartbeat command right after registration, we would not write anything to the file
Member
There was a problem hiding this comment.
The attributes registered_at and last_seen_at are not initialized with the same value. Both get set independently with Time.zone.now in different places of the code.
https://github.com/SUSE/rmt/blob/master/app/models/system.rb#L25 vs
https://github.com/SUSE/rmt/blob/master/app/controllers/application_controller.rb#L26
You might want to set registered_at directly from the last_seen_at value to guarantee they match.
Collaborator
Author
There was a problem hiding this comment.
updated the check to be under 10 seconds difference between the two values for a registration
jcomello
approved these changes
Feb 26, 2026
rjschwei
reviewed
Feb 26, 2026
rjschwei
approved these changes
Feb 26, 2026
digitaltom
reviewed
Feb 27, 2026
digitaltom
approved these changes
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
When the client runs a registration multiple endpoints are called,
one of them is the system update while the products of the system are
being activated
if both endpoints callbacks write to the file, it generates duplicate
records
We could use the system update only to update the file to be exported
to DW but the problem is the information is not complete when the
endpoint is invoked, meaning there would be duplicate records using
that endpoint information because of how registration works
The propose change uses the product activate endpoint to populate the
file whenever there is a product activation or upgrade (for example,
registration) and system update would populate the file when is
invoked outside a registration
How to test
Registration
Run registration on a instance for example
SLES 15 SP7PAYG`in the file, there should be no duplicates, there should be 11 entries
System update
after > 3 min, on the same instance, run heartbeat command, and check the file:
there should be no duplicates but new 11 entries, identical to the previous ones
but with a different
last_seen_atvalueSingle product activation
remove a product, add the product again, there should be no duplicates in the file
Change Type
Please select the correct option.
Checklist
Please check off each item if the requirement is met.
MANUAL.mdfile with any changes to the user experience.package/obs/rmt-server.changes.Review
Please check out our review guidelines
and get in touch with the author to get a shared understanding of the change.