-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
unlock the locked events while scale-down (close #3548) #4214
unlock the locked events while scale-down (close #3548) #4214
Conversation
Deploy preview for hasura-docs ready! Built with commit 5e53e06 |
I think for keeping the behavior predictable, we should still unlock all events during startup. |
This issue is meant to solve that problem, right? |
This issue, more precisely, is to unlock events which are in process in an instance which is scaled down i.e. exited gracefully. Now, suppose a container did not exit gracefully i.e crashed, there will be events which are still locked. Hence, they still need to unlocked. |
Review app for commit 8036c0c deployed to Heroku: https://hge-ci-pull-4214.herokuapp.com |
Yes, I understand that. But what about the multiple hasura instances running on the same db? If one hasura instance has locked some events and it's in the midst of processing those events and another hasura instance on startup will unlock those events and will start processing them(very likely that the events fetched by both the instances will be more or less the same), so it's possible that an event will be delivered twice |
That is fine. Our system is atleast-once delivery. We can tolerate duplicate deliveries of this kind. |
Ah, yes I forgot about the atleast-once delivery thing 🤦♂ . I'll unlock the events on startup. |
Having a locked (and unprocessed) event is much worse. We have made this trade-off in the design. |
8036c0c
to
09b15ac
Compare
Review app for commit 09b15ac deployed to Heroku: https://hge-ci-pull-4214.herokuapp.com |
It should be possible to do better than this (make some attempt to not redeliver during normal functioning), but if you think this is acceptable for now certainly happy to defer to you. |
@jberryman We can definitely improve on this (if it's not trivial then maybe in a separate PR). What are you thinking? |
server/src-lib/Hasura/App.hs
Outdated
@@ -269,27 +265,47 @@ runHGEServer ServeOptions{..} InitCtx{..} initTime = do | |||
asyncActionsProcessor (_scrCache cacheRef) _icPgPool _icHttpManager | |||
|
|||
-- start a background thread to check for updates | |||
_updateThread <- C.forkImmortal "checkForUpdates" logger $ liftIO $ | |||
_updateThread <- C.forkImmortal "checkForUpdates" logger $ liftIO $ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside: These trailing whitespace changes are a bummer, sorry. I've tried a plugin in vim that removed them but it ended up being really annoying for various reasons. I should try again. But It's not clear to me why the problem is trailing whitespace and not editors and tools that make a big deal of trailing whitespace...
either printErrJExit return res | ||
|
||
-- | shutdownEvents will be triggered when a graceful shutdown has been inititiated, it will | ||
-- get the locked events from the event engine context and then it will unlock all those events. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we add a little more on the implications here: "this means some pending events may get processed twice, etc"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I'll add that
server/src-lib/Hasura/Events/Lib.hs
Outdated
return $ EventEngineCtx{..} | ||
|
||
-- | Service events from our in-DB queue. | ||
-- | ||
-- There are a few competing concerns and constraints here; we want to... | ||
-- - fetch events in batches for lower DB pressure | ||
-- - don't fetch more than N at a time (since that can mean: space leak, less | ||
-- effective scale out, possible double sends for events we've checked out | ||
-- on exit (TODO clean shutdown procedure)) | ||
-- effective scale out |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm I guess this TODO isn't actually done here if we continue to unlock all events everytime an HGE comes online...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah yes, I removed it when I was not unlocking all the events at the startup, I'll add it again
Sorry, so after going through this: I don't see the point in this change if hge is going to unlock all events on startup. Isn't that strictly equivalent? |
I had a discussion above with @codingkarthik about this earlier in this PR. Unlocking events at startup is still required because instances can crash un-gracefully. Then what's the point of this PR? This is mostly to solve the issue specifically with managed scale down i.e. when you know that events in-memory need to be unlocked. Suppose you brought down num of hasura instances from 10 to 1, then the events in-memory will stay locked till a new hasura instances is spawned. |
Cool, it would be good also to have a comment to that effect (that although we unlock on startup we need graceful shutdown in order to handle the scale down use case) And I guess point out that this still doesn't solve the issue for a crash or impatient scaledown... @codingkarthik Tiru suggests opening a new ticket that will tackle how we can manage redelivery in a smarter way than simply unlocking all events on startup . One idea is simply to mark items as fresh after some timeout. |
@jberryman I'll add a comment about why we are unlocking all the locked events at startup. I'll create a new issue for the crash shutdown locked events and raise a PR. |
09b15ac
to
b645aa9
Compare
Review app for commit b645aa9 deployed to Heroku: https://hge-ci-pull-4214.herokuapp.com |
* Some events can still be delivered multiple times due to ungraceful shutdown
b645aa9
to
81022ad
Compare
Review app for commit 81022ad deployed to Heroku: https://hge-ci-pull-4214.herokuapp.com |
Review app for commit a1057b7 deployed to Heroku: https://hge-ci-pull-4214.herokuapp.com |
Review app for commit 5e53e06 deployed to Heroku: https://hge-ci-pull-4214.herokuapp.com |
Review app for commit f1f08fe deployed to Heroku: https://hge-ci-pull-4214.herokuapp.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codingkarthik, could you add a changelog entry for this change? Otherwise, I’m happy to trust @jberryman’s review here, so this seems good to merge.
00cceea
to
0ee12f2
Compare
Review app for commit 0ee12f2 deployed to Heroku: https://hge-ci-pull-4214.herokuapp.com |
CHANGELOG.md
Outdated
@@ -132,3 +132,4 @@ Read more about it in the [docs](https://hasura.io/docs/1.0/graphql/manual/auth/ | |||
- server: check expression in update permissions (close #384) (rfc #3750) (#3804) | |||
- console: show pre-release update notifications with opt out option (#3888) | |||
- console: handle invalid keys in permission builder (close #3848) (#3863) | |||
- server: unlock events the locked events fetched by the HGE when the HGE is scaled down (close #3548) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure I understand what this means? How is the user affected by this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would say something like: "manage inflight events when HGE instance is gracefully shutdown"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codingkarthik Also, this has been added to v1.2.0-beta.1
changelog entry. Pls put this at the top Next release
0ee12f2
to
800894c
Compare
800894c
to
98d9ace
Compare
Review app for commit 98d9ace deployed to Heroku: https://hge-ci-pull-4214.herokuapp.com |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changelog approved.
b77b366
to
2dffc81
Compare
Review app for commit 165a5a3 deployed to Heroku: https://hge-ci-pull-4214.herokuapp.com |
Review app https://hge-ci-pull-4214.herokuapp.com is deleted |
* Fix catalog version for v1.1.1 (close hasura#4354) (hasura#4355) * Fix catalog version for v1.1.1 * Remove entries of removed tables from hdb_catalog While downgrading catalog version from 32 -> 31, not removing entries in hdb_table and hdb_relationship for the tables that are removed in the downgrade, results in incosistent schema, when the server with downgraded version is started. This should probably be handled in a better fashion. With the change in this commit, the server is able to successfully start with downgraded catalog version 31. * Test downgrade command along with upgrade tests * gh: make all hge-server team members code owners (hasura#4361) * cli: event trigger retry_conf support to squash (close hasura#4296) (hasura#4324) * ci: fix cli-migrations-v2 build process (hasura#4273) * Fix erroneous error logging in WebSocket.onStop * dev.sh: generate coverage report after `dev.sh graphql-engine` exit * type is not required for jwk_url in JWT config (hasura#4334) * type is not required for jwk_url * remove type from JWTConfig * Omit type field in JWTConfig serialization if jwk_url is provided * remove type from jwk_url test suite * add changelog * fix docs with new format Co-authored-by: Alexis King <lexi.lambda@gmail.com> * cli: link cli-ext plugin with cli version (close hasura#4105) (hasura#4280) * console, cli, cli-ext: query support for actions (close hasura#4032) (hasura#4318) Co-authored-by: Aravind Shankar <aravind@hasura.io> * console: recover from SDL parse in actions type definition editor (fix hasura#4385) (hasura#4389) * console: redirect to /:table/browse from /:table (close hasura#4330) (hasura#4374) * cli: update docs to remove realize specific instructions (hasura#4398) * unlock inflight events when gracefully shutdown (close hasura#3548) (hasura#4214) * unlock the locked-events during graceful shutdown * Some events can still be delivered multiple times due to ungraceful shutdown * modify the preparevents documentation * modify the prepareEvents doc * update changelog Co-authored-by: Tirumarai Selvan <tiru@hasura.io> * cli(squash): add set_table_is_enum metadata type (close hasura#4394) (hasura#4395) * ci: add tests for cli-migrations image (hasura#4396) - Created new job test_and_build_cli_migrations which runs after test_and_build_cli - Build the cli-migrations and cli-migrations-v2 and save the images as tar image. - Run the test defined in each workflow v1 and v2. - Load the image that was built earlier in deploy step * console: convert theme files to typescript (hasura#4325) * allow reusing Postgres scalars in custom types & actions (close hasura#4125) (hasura#4333) * allow re-using Postgres scalars in custom types, close hasura#4125 * add pytest tests * update CHANGELOG.md * add a doc pointer for reusable postgres scalars * document the code, improve the CHANGELOG entry As suggested by @lexi-lambda * a bit more source code documentation, use WriterT to collect reused scalars * Apply suggestions from code review Co-Authored-By: Marion Schleifer <marion@hasura.io> * improve doc for Postgres scalars in custom graphql types * Add some more references to Note; fix Haddock syntax Also a few very minor tweaks: * Use HashSet instead of [] more pervasively * Export execWriterT from Hasura.Prelude * Use pattern guards in multi-way if * Tweak a few names/comments * Pull buildActions out of buildAndCollectInfo, use buildInfoMap * Tweak wording in documentation * incorporate changes in console code * account Postgres scalars for action input arguments -> Avoid unnecessary 'throw500' in making action schema * Review changes Co-authored-by: Marion Schleifer <marion@hasura.io> Co-authored-by: Alexis King <lexi.lambda@gmail.com> Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com> Co-authored-by: Aleksandra Sikora <ola.zxcvbnm@gmail.com> * cli: add hasura-collaborator-token and hasura-client-name to allowed headers (hasura#4414) * console: persist page size in data browser (hasura#4323) * server: Avoid duplicated test runs (hasura#4420) This avoids re-running tests when a parameterized test is specified that doesn't actually depend on its parameter. * cli: update makefile to set plugins branch ref (hasura#4421) * community: fix typo in event trigger doc (hasura#4426) * accept a new argument `claims_namespace_path` in JWT config (hasura#4365) * add new optional field `claims_namespace_path` in JWT config * return value when empty array is found in executeJSONPath * update the docs related to claims_namespace_path * improve encodeJSONPath, add property tests for parseJSONPath * throw error if both claims_namespace_path and claims_namespace are set * refactor the Data.Parser.JsonPath to Data.Parser.JSONPathSpec * update the JWT docs Co-Authored-By: Marion Schleifer <marion@hasura.io> Co-authored-by: Marion Schleifer <marion@hasura.io> Co-authored-by: rakeshkky <12475069+rakeshkky@users.noreply.github.com> Co-authored-by: Tirumarai Selvan <tirumarai.selvan@gmail.com> * server(actions): add support for queries (close hasura#4032) (hasura#4309) * add support for action queries * a new parameter `type` is added in the ArgumentDefinition, its value can be either `query` or `mutation` and it defaults to the latter * throw 400 when a query action is tried to explain * update the actions docs to include query actions * refactor the ToJSON and ToOrdJSON of ActionDefinition Co-authored-by: Rishichandra Wawhal <rishi@hasura.io> Co-authored-by: Tirumarai Selvan <tiru@hasura.io> * cli, console: actions dx improvements (close hasura#4306, hasura#4311) (hasura#4308) * small fixes (hasura#4430) * docs: fix bug in query actions docs (hasura#4434) * console: add possible undefined check (hasura#4445) * tag release v1.2.0-beta.4 (hasura#4428) Co-authored-by: Tirumarai Selvan <tiru@hasura.io> * server: _inc for non-integer numeric types (fix hasura#3573) (hasura#4429) * Allow `_inc` to update other numeric types in addition to integers * Add support for PostgreSQL's `money` field type * Add support for _inc on money types * Add note of generalized `_inc` support to changelog * console: surround string type column default value with quotes (close hasura#4371) (hasura#4423) * ci: skip server tests in PRs if there are no server changes (hasura#4412) * docs: update sample action handler URLs (hasura#4450) * allow special characters in json path's property name (close hasura#3890) (hasura#3892) * allow underscore prefix and special characters in json path * server: Rewrite/refactor JSONPath parser The JSONPath parser is also rewritten, the previous implementation was written in a very explicitly “recursive descent” style, but the whole point of using attoparsec is to be able to backtrack! Taking advantage of the combinators makes for a much simpler parser. Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com> Co-authored-by: Alexis King <lexi.lambda@gmail.com> Co-authored-by: Aleksandra Sikora <ola.zxcvbnm@gmail.com> Co-authored-by: Shahidh K Muhammed <shahidh@hasura.io> * console: change react ace editor theme to eclipse (close hasura#4437) (hasura#4443) * Move changelog entry to the right section (hasura#4493) * refresh the sample app realtime-poll (hasura#4337) * [fix](realtime-poll) refresh project realtime-poll * remove comment lines Co-authored-by: Praveen Durairaju <praveend.web@gmail.com> Co-authored-by: Praveen Durairaju <praveen@hasura.io> Co-authored-by: Tirumarai Selvan <tiru@hasura.io> * community: fix blog link in realtime chat app readme (hasura#4494) * server: support single $ as root json path (hasura#4482) * support single $ json path * support sql query with root json path * update changelog * update changelog Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io> Co-authored-by: Tirumarai Selvan <tiru@hasura.io> * Add API docs for `webhook_from_env` (hasura#4462) * Add API docs for `webhook_from_env` fixes hasura#4419 * add changelog * Fixes PR required change * Improve create_trigger api doc * Update docs/graphql/manual/api-reference/schema-metadata-api/event-triggers.rst Co-Authored-By: Marion Schleifer <marion@hasura.io> * Update docs/graphql/manual/api-reference/schema-metadata-api/event-triggers.rst Co-Authored-By: Marion Schleifer <marion@hasura.io> Co-authored-by: Tirumarai Selvan <tiru@hasura.io> Co-authored-by: Marion Schleifer <marion@hasura.io> * add additional tests for testing claims_namespace_path in JWT tokens (hasura#4481) * add additional tests for testing claims_namespace_path in JWT tokens - add tests for at root level and at a nested level * modify the JWT tests * combine the claims_namespace_path tests together in test-server.sh * change the order of the claims_namespace_path tests * change the order of the claims_namespace_path tests * Link to pytest docs in the server test suite READMEs (hasura#4425) * introduce effective timeout in actions async tests (hasura#4363) Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com> Co-authored-by: Tirumarai Selvan <tiru@hasura.io> * console: fix columns reordering for relationship tables in data browser (hasura#4483) * server: add support for timestamps without timezone to graphql-engine (fix hasura#1217) (hasura#4452) * Add support for timestamps without timezone to graphql-engine * Add tests for aggregations on timestamps without timezones * console miscellaneous fixes (hasura#4433) * format row count in data browser for readablity * move pre-release notification tooltip msg to top * remove extra localPresets key from migrations (close hasura#3976) * make nullable and unique labels for columns clickable in insert and modify * fix row delete for relationships in data browser * server: avoid integer overflows (fix hasura#576) (fix hasura#4368) (hasura#4435) * Update graphql-parser-hs and hence use `Scientific` directly The new version of graphql-parser-hs returns Scientific and Integer rather than Double and Int32, respectively. So we now need to do less work in graphql-engine, and we can process larger numbers. In practice, this means that when inserting a bigint, we no longer need to specify the inserted integer as text. This is also represented in the updated tests. * Generate int overflow error on insert * Document bigint insertion support in changelog * console: prevent trailing spaces while creating new role (close hasura#3871) (hasura#4497) * console: prevent trailing spaces while creating new role (close hasura#3871) (hasura#4497) * Add a hint on avoiding recompilation during typical dev workflow (hasura#4427) * fix recreating action's permission, fix hasura#4377 (hasura#4495) Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com> * fix typo in jsonb query filters to match operator api (hasura#4505) Co-authored-by: Tirumarai Selvan <tiru@hasura.io> * cli: spinner bug, add cli_environment in global config (hasura#4459) close hasura#4456 close hasura#4436 close hasura#4496 * cli: add check_metadata_consistency for v2 workflow migrations (hasura#4392) * ci: add force flag while creating pull request using hub (hasura#4431) * cli(test): fix cli init test to use initDir from subtest group (hasura#4490) * console: migrate checkbox, icon and radio button to TypeScript (hasura#4373) * cli(test): refactor integration test metadata directory (hasura#4491) * console: allow adding post-update checks in update permissions (close hasura#4142) (hasura#4313) * fix nested errors array in ws-server response log (hasura#3971) * server: Improve `queryModifiesSchemaCache` check for run_sql (hasura#4283) The previous check was too conservative and acquired a lock on the schema cache in situations where it was unnecessary. This change exposes the logic run_sql uses to determine whether to use the metadata check to make the check more precise. * cli: add suport for .env file (fix hasura#4129) (hasura#4454) * cli: validate endpoint using ParseRequestURI (fix hasura#4407) (hasura#4416) * docs: add reference docs for cli (fix hasura#4327) (hasura#4408) Co-Authored-By: Marion Schleifer <marion@hasura.io> * make arguments field optional in ActionDefinition (hasura#4521) * docs: add mapping of hasura operators - pg operators (close hasura#4056) (hasura#4502) * console: preserve the returning field set in a derived action (hasura#4530) * fix creating relationships for custom object types with fields reusing Postgres scalars (fix hasura#4447) (hasura#4455) * fix creating relationships for custom object types with fields reusing Postgres scalars, close hasura#4447 * fix changelog entry * rearrange entries Co-authored-by: Tirumarai Selvan <tiru@hasura.io> * fix intermittent errors occur when query actions used with variables (hasura#4527) * don't add query actions to the plan cache Co-authored-by: rakeshkky <12475069+rakeshkky@users.noreply.github.com> * improve debug information in actions errors response (close hasura#4031) (hasura#4432) * config options for internal errors for non-admin role, close hasura#4031 More detailed action debug info is added in response 'internal' field * add docs * update CHANGELOG.md * set admin graphql errors option in ci tests, minor changes to docs * fix tests Don't use any auth for sync actions error tests. The request body changes based on auth type in session_variables (x-hasura-auth-mode) * Apply suggestions from code review Co-Authored-By: Marion Schleifer <marion@hasura.io> * use a new sum type to represent the inclusion of internal errors As suggested in review by @0x777 -> Move around few modules in to specific API folder -> Saperate types from Init.hs * fix tests Don't use any auth for sync actions error tests. The request body changes based on auth type in session_variables (x-hasura-auth-mode) * move 'HttpResponse' to 'Hasura.HTTP' module * update change log with breaking change warning * Update CHANGELOG.md Co-authored-by: Marion Schleifer <marion@hasura.io> Co-authored-by: Tirumarai Selvan <tiru@hasura.io> * backend only insert permissions (rfc hasura#4120) (hasura#4224) * move user info related code to Hasura.User module * the RFC hasura#4120 implementation; insert permissions with admin secret * revert back to old RoleName based schema maps An attempt made to avoid duplication of schema contexts in types if any role doesn't possess any admin secret specific schema * fix compile errors in haskell test * keep 'user_vars' for session variables in http-logs * no-op refacto * tests for admin only inserts * update docs for admin only inserts * updated CHANGELOG.md * default behaviour when admin secret is not set * fix x-hasura-role to X-Hasura-Role in pytests * introduce effective timeout in actions async tests * update docs for admin-secret not configured case * Update docs/graphql/manual/api-reference/schema-metadata-api/permission.rst Co-Authored-By: Marion Schleifer <marion@hasura.io> * Apply suggestions from code review Co-Authored-By: Marion Schleifer <marion@hasura.io> * a complete iteration backend insert permissions accessable via 'x-hasura-backend-privilege' session variable * console changes for backend-only permissions * provide tooltip id; update labels and tooltips; * requested changes * requested changes - remove className from Toggle component - use appropriate function name (capitalizeFirstChar -> capitalize) * use toggle props from definitelyTyped * fix accidental commit * Revert "introduce effective timeout in actions async tests" This reverts commit b7a59c1. * generate complete schema for both 'default' and 'backend' sessions * Apply suggestions from code review Co-Authored-By: Marion Schleifer <marion@hasura.io> * remove unnecessary import, export Toggle as is * update session variable in tooltip * 'x-hasura-use-backend-only-permissions' variable to switch * update help texts * update docs * update docs * update console help text * regenerate package-lock * serve no backend schema when backend_only: false and header set to true - Few type name refactor as suggested by @0x777 * update CHANGELOG.md * Update CHANGELOG.md * Update CHANGELOG.md * fix a merge bug where a certain entity didn't get removed Co-authored-by: Marion Schleifer <marion@hasura.io> Co-authored-by: Rishichandra Wawhal <rishi@hasura.io> Co-authored-by: rikinsk <rikin.kachhia@gmail.com> Co-authored-by: Tirumarai Selvan <tiru@hasura.io> * console: support materialized views (close hasura#91) (hasura#4270) * tag release v1.2.0-beta.5 (hasura#4555) * cli: remove irrelevant flags from init command (close hasura#4508) (hasura#4549) * cli: allow initialising project in current directory * update CHANGELOG.md * validate pwd is neither filesystem root nor an existing hasura project * update help text and docs for init command * minor fixes * console: make graphiql panel use whole height (hasura#4553) * console: migrate graphql, sql, main utils to TS (hasura#4522) * console: migrate GqlCompabilityWarning to TS (hasura#4544) * console: fix table columns type comparision during column edit (close hasura#4125) (hasura#4393) * console: update and freeze graphiql explorer to support operation transforms (hasura#4567) * server: allow computed fields to have access to Hasura's session variables (fix hasura#3846) (hasura#4486) * Allow computed fields to have access to Hasura's session variables * Inform about session args for computed fields in changelog and docs * Add tests for session arguments for computed fields (and the respective errors) Co-authored-by: Tirumarai Selvan <tiru@hasura.io> Co-authored-by: Marion Schleifer <marion@hasura.io> Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com> * docs: data validations (close hasura#4085) (hasura#4260) * docs: add version info to the CLI .env file section (close hasura#4572) (hasura#4573) * docs: misc changes (hasura#4584) * change v1.0 -> v1.x in version dropdown * run sphinx build with upto 4 parallel processes * cli: add support for servers with self-signed certs (fix hasura#4564) (hasura#4582) Co-Authored-By: Marion Schleifer <marion@hasura.io> Co-authored-by: nizar-m <19857260+nizar-m@users.noreply.github.com> Co-authored-by: Alexis King <lexi.lambda@gmail.com> Co-authored-by: Aravind Shankar <aravind@hasura.io> Co-authored-by: Brandon Simmons <brandon.m.simmons@gmail.com> Co-authored-by: Tirumarai Selvan <tiru@hasura.io> Co-authored-by: Rishichandra Wawhal <rishi@hasura.io> Co-authored-by: ShahAnuj2610 <anujshah584@gmail.com> Co-authored-by: Shraddha Agrawal <shraddha.agrawal000@gmail.com> Co-authored-by: Karthikeyan Chinnakonda <karthikeyan@hasura.io> Co-authored-by: Ali Oğuzhan Yıldız <aoguzhanyildiz@gmail.com> Co-authored-by: Rakesh Emmadi <12475069+rakeshkky@users.noreply.github.com> Co-authored-by: Marion Schleifer <marion@hasura.io> Co-authored-by: Vamshi Surabhi <0x777@users.noreply.github.com> Co-authored-by: Aleksandra Sikora <ola.zxcvbnm@gmail.com> Co-authored-by: Aravind <aravindkp@hasura.io> Co-authored-by: Aleksandra Sikora <aleksandra@hasura.io> Co-authored-by: Auke Booij <auke@tulcod.com> Co-authored-by: Sitian Liu <goldensunliu@gmail.com> Co-authored-by: Tirumarai Selvan <tirumarai.selvan@gmail.com> Co-authored-by: Shahidh K Muhammed <shahidh@hasura.io> Co-authored-by: Auke Booij <auke@hasura.io> Co-authored-by: Rikin Kachhia <54616969+rikinsk@users.noreply.github.com> Co-authored-by: Toan Nguyen <hgiasac@gmail.com> Co-authored-by: Jigyasu Arya <arya.jigyasu6815@gmail.com> Co-authored-by: Areski Belaid <areski@gmail.com> Co-authored-by: Praveen Durairaju <praveend.web@gmail.com> Co-authored-by: Praveen Durairaju <praveen@hasura.io> Co-authored-by: Marco Pegoraro <marco.pegoraro@gmail.com> Co-authored-by: Avi Moondra <avimoondra@gmail.com> Co-authored-by: ryo <ba068082@gmail.com> Co-authored-by: rikinsk <rikin.kachhia@gmail.com> Co-authored-by: Antoine Leblanc <antoine@hasura.io> Co-authored-by: Muhammad Ubaid Raza <mubaidr@gmail.com> Co-authored-by: Fadi Khadra <fdkhadra@gmail.com> Co-authored-by: Aravind <aravindkp@outlook.in>
…asura#4214) * unlock the locked-events during graceful shutdown * Some events can still be delivered multiple times due to ungraceful shutdown * modify the preparevents documentation * modify the prepareEvents doc * update changelog Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
…asura#4214) * unlock the locked-events during graceful shutdown * Some events can still be delivered multiple times due to ungraceful shutdown * modify the preparevents documentation * modify the prepareEvents doc * update changelog Co-authored-by: Tirumarai Selvan <tiru@hasura.io>
were fetched by the HGE and it will always remain in the locked state
Description
Changelog
CHANGELOG.md
is updated with user-facing content relevant to this PR.Affected components
Related Issues
#3548
Solution and Design
Whenever events are fetched from the database, the fetched event IDs will be stored in a cache and after the event has been processed, the event ID will be removed from the cache.
When a graceful shutdown is initiated, all the events that have been locked will be stored in the cache and then those events will be unlocked.
Steps to test and verify
Create an event trigger and do mutations(preferably a lot, because we will require events to be fetched by the HGE while we initiate a graceful shutdown) and initiate a graceful shutdown.
Limitations, known bugs & workarounds
Server checklist
Catalog upgrade
Does this PR change Hasura Catalog version?
Metadata
Does this PR add a new Metadata feature?
run_sql
auto manages the new metadata through schema diffing?run_sql
auto manages the definitions of metadata on renaming?export_metadata
/replace_metadata
supports the new metadata added?GraphQL
Breaking changes
[ X ] No Breaking changes
There are breaking changes:
Metadata API
Existing
query
types:args
payload which is not backward compatibleJSON
schemaGraphQL API
Schema Generation:
NamedType
Schema Resolve:-
null
value for any input fieldsLogging
JSON
schema has changedtype
names have changed