manageiq icon indicating copy to clipboard operation
manageiq copied to clipboard

Duplicate records in settings_changes

Open kbrock opened this issue 2 years ago • 8 comments

We are updating settings in the orchestrator: entrypoint:90

It is creating duplicates in the container environments:

SELECT MIN(id) as id, resource_type, resource_id, key, COUNT(*) as count
FROM settings_changes
GROUP BY 2, 3, 4
HAVING COUNT(*) > 1
ORDER BY 1, 2, 3;
id resource_type resource_id key count
1 MiqRegion 1 /authentication/mode 18
2 MiqRegion 1 /authentication/httpd_role 18
3 MiqRegion 1 /authentication/sso_enabled 18
4 MiqRegion 1 /authentication/saml_enabled 18
5 MiqRegion 1 /authentication/oidc_enabled 18
6 MiqRegion 1 /authentication/provider_type 18
7 MiqRegion 1 /authentication/local_login_disabled 18
8 MiqRegion 1 /server/worker_monitor/enforce_resource_constraints 18
  • The records are all written together and in the same order.
  • All keys have the same value. (e.g.: all mode records have the same value)
  • All ids are in the same region (0)

Unfortunately, this spec which should exercises the issue passes 🍏 :

    it "with a previous change, now to the same value" do
      expect(SettingsChange.count).to eq 0

      described_class.save!(miq_server.reload, :api => {:token_ttl => "1.hour"})
      update = SettingsChange.first
      described_class.save!(miq_server.reload, :api => {:token_ttl => "1.hour"})
      described_class.save!(miq_server, :api => {:token_ttl => "1.hour"})
      described_class.save!(miq_server.reload, :api => {:token_ttl => "1.hour"})

      miq_server.reload
      expect(miq_server.settings_changes.count).to eq 1
      expect(miq_server.settings_changes.first).to have_attributes(
        :id    => update.id,
        :key   => "/api/token_ttl",
        :value => "1.hour"
      )

      expect(SettingsChange.count).to eq 1
    end

kbrock avatar May 26 '23 14:05 kbrock

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation.

miq-bot avatar Aug 28 '23 00:08 miq-bot

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

miq-bot avatar Dec 11 '23 00:12 miq-bot

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

miq-bot avatar Mar 18 '24 00:03 miq-bot

This issue has been automatically marked as stale because it has not been updated for at least 3 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

miq-bot avatar Jun 24 '24 00:06 miq-bot