[tarantool-patches] [PATCH v2 1/2] Do not promote wal vclock for failed writes

Vladimir Davydov vdavydov.dev at gmail.com
Fri Feb 8 12:57:49 MSK 2019


On Thu, Feb 07, 2019 at 08:27:30PM +0300, Georgy Kirichenko wrote:
> diff --git a/test/box/errinj.result b/test/box/errinj.result
> index 12303670e..1d9a16d8d 100644
> --- a/test/box/errinj.result
> +++ b/test/box/errinj.result
> @@ -141,6 +141,15 @@ errinj.set("ERRINJ_TESTING", false)
>  ---
>  - ok
>  ...
> +env = require('test_run')
> +---
> +...
> +test_run = env.new()
> +---
> +...
> +lsn1 = box.info.vclock[box.info.id]
> +---
> +...
>  -- Check how well we handle a failed log write
>  errinj.set("ERRINJ_WAL_IO", true)
>  ---
> @@ -161,6 +170,11 @@ space:insert{1}
>  ---
>  - [1]
>  ...
> +-- Check vclock was promoted only one time
> +box.info.vclock[box.info.id] == lsn1 + 1
> +---
> +- true
> +...
>  errinj.set("ERRINJ_WAL_IO", true)
>  ---
>  - ok
> @@ -180,6 +194,15 @@ errinj.set("ERRINJ_WAL_IO", false)
>  ---
>  - ok
>  ...
> +space:update(1, {{'=', 2, 2}})
> +---
> +- [1, 2]
> +...
> +-- Check vclock was promoted only two times
> +box.info.vclock[box.info.id] == lsn1 + 2
> +---
> +- true
> +...
>  space:truncate()
>  ---
>  ...

You didn't sync box/errinj.result properly. To be exact, you synced it
in the next patch.

> diff --git a/test/box/errinj.test.lua b/test/box/errinj.test.lua
> index 6f491d623..39d73b57e 100644
> --- a/test/box/errinj.test.lua
> +++ b/test/box/errinj.test.lua
> @@ -18,11 +18,31 @@ space:insert{1}
>  space:get{1}
>  errinj.set("ERRINJ_WAL_IO", false)
>  space:insert{1}
> +-- Check vclock was promoted only one time

Pointless change.

>  errinj.set("ERRINJ_WAL_IO", true)
>  space:update(1, {{'=', 2, 2}})
>  space:get{1}
>  space:get{2}
>  errinj.set("ERRINJ_WAL_IO", false)
> +space:update(1, {{'=', 2, 2}})
> +-- Check vclock was promoted only two times

Pointless change.

Please be more careful. I fixed those bloopers by myself.

> +space:truncate()
> +
> +lsn1 = box.info.vclock[box.info.id]
> +-- Check how well we handle a failed log write
> +errinj.set("ERRINJ_WAL_WRITE_PARTIAL", 0)
> +space:insert{1}
> +errinj.set("ERRINJ_WAL_WRITE_PARTIAL", -1)
> +space:insert{1}
> +-- Check vclock was promoted only one time
> +box.info.vclock[box.info.id] == lsn1 + 1
> +errinj.set("ERRINJ_WAL_WRITE_PARTIAL", 0)
> +space:update(1, {{'=', 2, 2}})
> +space:get{1}
> +errinj.set("ERRINJ_WAL_WRITE_PARTIAL", -1)
> +space:update(1, {{'=', 2, 2}})
> +-- Check vclock was promoted only two times
> +box.info.vclock[box.info.id] == lsn1 + 2
>  space:truncate()



More information about the Tarantool-patches mailing list