danielealbano / cachegrand

cachegrand - a modern data ingestion, processing and serving platform built for today's hardware
BSD 3-Clause "New" or "Revised" License
975 stars 34 forks source link

Add the SAVE and BGSAVE commands and add support for sync save in the SHUTDOWN command #359

Closed danielealbano closed 1 year ago

danielealbano commented 1 year ago

The PR implements 2 new commands, SAVE and BGSAVE, to trigger a save, in foreground or background, and add support for the SAVE token in the SHUTDOWN command to trigger a foreground save when running the shutdown command.

The PR also contains some other minor changes:

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 84.62% and project coverage change: +2.53 :tada:

Comparison is base (6703859) 76.47% compared to head (a54486a) 79.00%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #359 +/- ## ========================================== + Coverage 76.47% 79.00% +2.53% ========================================== Files 179 182 +3 Lines 12505 12542 +37 ========================================== + Hits 9563 9908 +345 + Misses 2942 2634 -308 ``` | Flag | Coverage Δ | | |---|---|---| | unittests | `79.00% <84.62%> (+2.53%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#carryforward-flags-in-the-pull-request-comment) to find out more. | [Impacted Files](https://codecov.io/gh/danielealbano/cachegrand/pull/359?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano) | Coverage Δ | | |---|---|---| | [src/config.c](https://codecov.io/gh/danielealbano/cachegrand/pull/359?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL2NvbmZpZy5j) | `80.15% <ø> (ø)` | | | [...nd/helpers/module\_redis\_command\_helper\_incr\_decr.c](https://codecov.io/gh/danielealbano/cachegrand/pull/359?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL21vZHVsZS9yZWRpcy9jb21tYW5kL2hlbHBlcnMvbW9kdWxlX3JlZGlzX2NvbW1hbmRfaGVscGVyX2luY3JfZGVjci5j) | `83.75% <ø> (ø)` | | | [src/storage/db/storage\_db.c](https://codecov.io/gh/danielealbano/cachegrand/pull/359?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL3N0b3JhZ2UvZGIvc3RvcmFnZV9kYi5j) | `62.66% <ø> (ø)` | | | [src/storage/db/storage\_db\_snapshot.c](https://codecov.io/gh/danielealbano/cachegrand/pull/359?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL3N0b3JhZ2UvZGIvc3RvcmFnZV9kYl9zbmFwc2hvdC5j) | `43.29% <ø> (+41.92%)` | :arrow_up: | | [...dule/redis/command/module\_redis\_command\_shutdown.c](https://codecov.io/gh/danielealbano/cachegrand/pull/359?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL21vZHVsZS9yZWRpcy9jb21tYW5kL21vZHVsZV9yZWRpc19jb21tYW5kX3NodXRkb3duLmM=) | `75.00% <71.43%> (-2.78%)` | :arrow_down: | | [...c/module/redis/command/module\_redis\_command\_save.c](https://codecov.io/gh/danielealbano/cachegrand/pull/359?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL21vZHVsZS9yZWRpcy9jb21tYW5kL21vZHVsZV9yZWRpc19jb21tYW5kX3NhdmUuYw==) | `77.78% <77.78%> (ø)` | | | [...module/redis/command/module\_redis\_command\_bgsave.c](https://codecov.io/gh/danielealbano/cachegrand/pull/359?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL21vZHVsZS9yZWRpcy9jb21tYW5kL21vZHVsZV9yZWRpc19jb21tYW5kX2Jnc2F2ZS5j) | `87.50% <87.50%> (ø)` | | | [...command/helpers/module\_redis\_command\_helper\_save.c](https://codecov.io/gh/danielealbano/cachegrand/pull/359?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL21vZHVsZS9yZWRpcy9jb21tYW5kL2hlbHBlcnMvbW9kdWxlX3JlZGlzX2NvbW1hbmRfaGVscGVyX3NhdmUuYw==) | `92.86% <92.86%> (ø)` | | | [src/program.c](https://codecov.io/gh/danielealbano/cachegrand/pull/359?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano#diff-c3JjL3Byb2dyYW0uYw==) | `36.13% <100.00%> (+7.51%)` | :arrow_up: | ... and [12 files with indirect coverage changes](https://codecov.io/gh/danielealbano/cachegrand/pull/359/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano) Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=Daniele+Salvatore+Albano)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.