zitadel/internal/query
Tim Möhlmann c0e45b63d8
fix: reset the call timestamp after a bulk trigger (#6080)
* reproduce #5808

Add an integration test that imports and gets N amount of human users.
- With N set to 1-10 the operation seems to succeed always
- With N set to 100 the operation seems to fail between 1 and 7 times.

* fix merge issue

* fix: reset the call timestamp after a bulk trigger

With the use of `AS OF SYSTEM TIME` in queries,
there was a change for the query package not
finding the latest projection verson after
a bulk trigger.
If events where processed in the bulk trigger,
the resulting row timestamp would be after the call
start timestamp.
This sometimes resulted in consistency issues when
Set and Get API methods are called in short succession.
For example a Import and Get user could sometimes result in a Not Found
error.

Although the issue was reported for the Management API user import,
it is likely this bug contributed to the flaky integration and e2e tests.

Fixes #5808

* trigger bulk action in GetSession

* don't use the new context in handler schedule

* disable reproduction test

---------

Co-authored-by: Livio Spring <livio.a@gmail.com>
2023-07-07 08:15:05 +00:00
..
projection feat: push telemetry (#6027) 2023-07-06 08:38:13 +02:00
action_flow_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
action_flow.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
action_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
action.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
app_test.go feat: allow skip of success page for native apps (#5627) 2023-04-11 15:07:32 +00:00
app.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
authn_key_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
authn_key.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
certificate_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
certificate.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
current_sequence_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
current_sequence.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
custom_text_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
custom_text.go feat: add Help/Support e-mail for instance/org (#5445) 2023-03-28 21:36:52 +02:00
device_auth_test.go feat: device authorization RFC 8628 (#5646) 2023-04-19 08:46:02 +00:00
device_auth.go feat: device authorization RFC 8628 (#5646) 2023-04-19 08:46:02 +00:00
domain_policy_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
domain_policy.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
event.go fix: ignore 0 retention on event search (#5614) 2023-04-05 17:56:11 +00:00
failed_events_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
failed_events.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
iam_member_test.go chore(console): remove first and lastName fallback from user (#5629) 2023-04-11 15:56:51 +00:00
iam_member.go chore(console): remove first and lastName fallback from user (#5629) 2023-04-11 15:56:51 +00:00
idp_login_policy_link_test.go feat(api): new settings service (#5775) 2023-05-11 09:23:40 +00:00
idp_login_policy_link.go feat(api): new settings service (#5775) 2023-05-11 09:23:40 +00:00
idp_template_test.go fix: remove idp templates when using old / deprecated delete method (#5685) 2023-04-17 08:20:49 +00:00
idp_template.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
idp_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
idp_user_link_test.go fix: remove idp templates when using old / deprecated delete method (#5685) 2023-04-17 08:20:49 +00:00
idp_user_link.go feat(login): use new IDP templates (#5315) 2023-02-28 21:20:58 +01:00
idp.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
instance_domain_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
instance_domain.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
instance_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
instance.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
key_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
key.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
label_policy.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
languages.go chore(v2): move to new org (#3499) 2022-04-26 23:01:45 +00:00
lockout_policy_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
lockout_policy.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
login_name.go feat: remove org (#4148) 2022-11-30 17:01:17 +01:00
login_policy_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
login_policy.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
mail_template.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
member_roles.go fix(query): realtime data on defined requests (#3726) 2022-06-14 07:51:00 +02:00
member.go chore(console): remove first and lastName fallback from user (#5629) 2023-04-11 15:56:51 +00:00
message_text_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
message_text.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
milestone_test.go feat: push telemetry (#6027) 2023-07-06 08:38:13 +02:00
milestone.go feat: push telemetry (#6027) 2023-07-06 08:38:13 +02:00
notification_policy_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
notification_policy.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
notification_provider_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
notification_provider.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
oidc_settings_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
oidc_settings.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
org_domain_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
org_domain.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
org_member_test.go chore(console): remove first and lastName fallback from user (#5629) 2023-04-11 15:56:51 +00:00
org_member.go chore(console): remove first and lastName fallback from user (#5629) 2023-04-11 15:56:51 +00:00
org_metadata_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
org_metadata.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
org_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
org.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
password_age_policy_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
password_age_policy.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
password_complexity_policy_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
password_complexity_policy.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
prepare_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
privacy_policy_test.go feat: add Help/Support e-mail for instance/org (#5445) 2023-03-28 21:36:52 +02:00
privacy_policy.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
project_grant_member_test.go chore(console): remove first and lastName fallback from user (#5629) 2023-04-11 15:56:51 +00:00
project_grant_member.go chore(console): remove first and lastName fallback from user (#5629) 2023-04-11 15:56:51 +00:00
project_grant_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
project_grant.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
project_member_test.go chore(console): remove first and lastName fallback from user (#5629) 2023-04-11 15:56:51 +00:00
project_member.go chore(console): remove first and lastName fallback from user (#5629) 2023-04-11 15:56:51 +00:00
project_role_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
project_role.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
project_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
project.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
query.go feat(api): list authentication method types in user api v2 (#6058) 2023-06-20 16:23:28 +00:00
quota_model.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
quota_notifications_model.go feat: call webhooks at least once (#5454) 2023-03-28 22:09:06 +00:00
quota_notifications.go feat: call webhooks at least once (#5454) 2023-03-28 22:09:06 +00:00
quota_period.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
search_query_test.go fix(user): add search query for login name (#4173) 2022-10-31 13:03:23 +00:00
search_query.go feat: push telemetry (#6027) 2023-07-06 08:38:13 +02:00
secret_generator_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
secret_generators.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
security_policy.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
session.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
sessions_test.go fix: provide domain in session, passkey and u2f (#6097) 2023-06-27 14:36:07 +02:00
sms_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
sms.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
smtp_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
smtp.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
user_auth_method_test.go feat(api): list authentication method types in user api v2 (#6058) 2023-06-20 16:23:28 +00:00
user_auth_method.go feat(api): list authentication method types in user api v2 (#6058) 2023-06-20 16:23:28 +00:00
user_grant_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
user_grant.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
user_membership_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
user_membership.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
user_metadata_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
user_metadata.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
user_otp.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
user_password.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
user_personal_access_token_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
user_personal_access_token.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
user_test.go perf: query data AS OF SYSTEM TIME (#5231) 2023-02-27 22:36:43 +01:00
user.go fix: reset the call timestamp after a bulk trigger (#6080) 2023-07-07 08:15:05 +00:00
zitadel_permission.go fix(query): add tracing for each method (#4777) 2022-12-01 09:18:53 +01:00