Discussion:
[redis-db] Redis scripts: transaction guarantees in case of server crash
Kian Karas
2018-10-03 12:21:17 UTC
Permalink
Hi

The documentation (https://redis.io/topics/transactions) describes how
transactions (MULTI/EXEC) are handled in case of server crash: the
transaction is applied fully or not at all. It also states that "A Redis
script is transactional by definition".

1) Does this mean that Redis script "transactions" are written to
persistent storage as transactions (e.g. with a begin/end marker) and a
partial script execution (e.g. due to power loss) will be detected and
cleaned up during server start?
2) Can partial transactions only be present in AOF files or in RDB too?

I'm working on a product that can loose power at any moment (we haven't
used scripts until now). Hence, I need to be sure that power loss during
script execution will never cause partial modifications.

Regards
Kian
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+***@googlegroups.com.
To post to this group, send email to redis-***@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
h***@gmail.com
2018-10-03 15:56:10 UTC
Permalink
Read further in that 2nd bullet point on the transactions documentation
page:

*However if the Redis server crashes or is killed by the system
administrator in some hard way it is possible that only a partial number of
operations are registered. Redis will detect this condition at restart, and
will exit with an error**. Using the redis-check-aof tool it is possible to
fix the append only file that will remove the partial transaction so that
the server can start again.*

Redis calls these blocks of commands (between MULTI and EXEC)
"transactions", but they do not work the same way as transactions in
relational databases and other software products.
Post by Kian Karas
Hi
The documentation (https://redis.io/topics/transactions) describes how
transactions (MULTI/EXEC) are handled in case of server crash: the
transaction is applied fully or not at all. It also states that "A Redis
script is transactional by definition".
1) Does this mean that Redis script "transactions" are written to
persistent storage as transactions (e.g. with a begin/end marker) and a
partial script execution (e.g. due to power loss) will be detected and
cleaned up during server start?
2) Can partial transactions only be present in AOF files or in RDB too?
I'm working on a product that can loose power at any moment (we haven't
used scripts until now). Hence, I need to be sure that power loss during
script execution will never cause partial modifications.
Regards
Kian
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+***@googlegroups.com.
To post to this group, send email to redis-***@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
Kian Karas
2018-10-03 16:50:43 UTC
Permalink
I don't think I understand your point.

My questions, whether what you referenced also applies to "Redis scripts"
or it only applies to MULTI/EXEC.
Post by h***@gmail.com
Read further in that 2nd bullet point on the transactions documentation
*However if the Redis server crashes or is killed by the system
administrator in some hard way it is possible that only a partial number of
operations are registered. Redis will detect this condition at restart, and
will exit with an error**. Using the redis-check-aof tool it is possible
to fix the append only file that will remove the partial transaction so
that the server can start again.*
Redis calls these blocks of commands (between MULTI and EXEC)
"transactions", but they do not work the same way as transactions in
relational databases and other software products.
Post by Kian Karas
Hi
The documentation (https://redis.io/topics/transactions) describes how
transactions (MULTI/EXEC) are handled in case of server crash: the
transaction is applied fully or not at all. It also states that "A Redis
script is transactional by definition".
1) Does this mean that Redis script "transactions" are written to
persistent storage as transactions (e.g. with a begin/end marker) and a
partial script execution (e.g. due to power loss) will be detected and
cleaned up during server start?
2) Can partial transactions only be present in AOF files or in RDB too?
I'm working on a product that can loose power at any moment (we haven't
used scripts until now). Hence, I need to be sure that power loss during
script execution will never cause partial modifications.
Regards
Kian
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Redis DB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to redis-db+***@googlegroups.com.
To post to this group, send email to redis-***@googlegroups.com.
Visit this group at https://groups.google.com/group/redis-db.
For more options, visit https://groups.google.com/d/optout.
Loading...