System.Collections.Generic.KeyNotFoundException: The given key was not present in the cache during load test with ignite 2.9.1

classic Classic list List threaded Threaded
4 messages Options
Charlin Charlin
Reply | Threaded
Open this post in threaded view
|

System.Collections.Generic.KeyNotFoundException: The given key was not present in the cache during load test with ignite 2.9.1

Hi,
I am getting below error while running load test with ignite 2.9.1 but 
ContainsKey is successful and thereafter  Get by key is failed
The given key was not present in the cache: TestModel:HH|E6661DD9C3@$@@$@@$@(null)@$@@$@(null)@$@System.Collections.Generic.KeyNotFoundException: The given key was not present in the cache: testModel:HH|E6661DD9C3
   at Apache.Ignite.Core.Impl.Cache.CacheImpl`2.<>c__DisplayClass30.<Get>b__2f(IBinaryStream stream, Int64 res)
   at Apache.Ignite.Core.Impl.PlatformJniTarget.InStreamOutLong[TR](Int32 type, Func`2 outAction, Func`3 inAction, Func`2 readErrorAction)
   at Apache.Ignite.Core.Impl.Cache.CacheImpl`2.Get(TK key)

Code snippet:
image.png

Thanks & Regards,
Charlin
 
Ilya Kazakov Ilya Kazakov
Reply | Threaded
Open this post in threaded view
|

Re: System.Collections.Generic.KeyNotFoundException: The given key was not present in the cache during load test with ignite 2.9.1

Hello, Charlin!

Could you show any reproducer, please?

------------------------
Thanks, Ilya!

пт, 12 февр. 2021 г. в 18:43, Charlin S <[hidden email]>:
Hi,
I am getting below error while running load test with ignite 2.9.1 but 
ContainsKey is successful and thereafter  Get by key is failed
The given key was not present in the cache: TestModel:HH|E6661DD9C3@$@@$@@$@(null)@$@@$@(null)@$@System.Collections.Generic.KeyNotFoundException: The given key was not present in the cache: testModel:HH|E6661DD9C3
   at Apache.Ignite.Core.Impl.Cache.CacheImpl`2.<>c__DisplayClass30.<Get>b__2f(IBinaryStream stream, Int64 res)
   at Apache.Ignite.Core.Impl.PlatformJniTarget.InStreamOutLong[TR](Int32 type, Func`2 outAction, Func`3 inAction, Func`2 readErrorAction)
   at Apache.Ignite.Core.Impl.Cache.CacheImpl`2.Get(TK key)

Code snippet:
image.png

Thanks & Regards,
Charlin
 
ptupitsyn ptupitsyn
Reply | Threaded
Open this post in threaded view
|

Re: System.Collections.Generic.KeyNotFoundException: The given key was not present in the cache during load test with ignite 2.9.1

Hi Charlin,

Most likely you should use a single TryGet [1] call instead of ContainsKey + Get,
it achieves the same logic more efficiently and without the risk of race conditions.

Looks like the key gets removed in between the ContainsKey and Get calls
by another thread / process / node.



On Mon, Feb 15, 2021 at 5:12 AM Ilya Kazakov <[hidden email]> wrote:
Hello, Charlin!

Could you show any reproducer, please?

------------------------
Thanks, Ilya!

пт, 12 февр. 2021 г. в 18:43, Charlin S <[hidden email]>:
Hi,
I am getting below error while running load test with ignite 2.9.1 but 
ContainsKey is successful and thereafter  Get by key is failed
The given key was not present in the cache: TestModel:HH|E6661DD9C3@$@@$@@$@(null)@$@@$@(null)@$@System.Collections.Generic.KeyNotFoundException: The given key was not present in the cache: testModel:HH|E6661DD9C3
   at Apache.Ignite.Core.Impl.Cache.CacheImpl`2.<>c__DisplayClass30.<Get>b__2f(IBinaryStream stream, Int64 res)
   at Apache.Ignite.Core.Impl.PlatformJniTarget.InStreamOutLong[TR](Int32 type, Func`2 outAction, Func`3 inAction, Func`2 readErrorAction)
   at Apache.Ignite.Core.Impl.Cache.CacheImpl`2.Get(TK key)

Code snippet:
image.png

Thanks & Regards,
Charlin
 
Charlin Charlin
Reply | Threaded
Open this post in threaded view
|

Re: System.Collections.Generic.KeyNotFoundException: The given key was not present in the cache during load test with ignite 2.9.1

Hello

Thanks for your help.

I will try with the tryget option.

Thanks & Regards,
Charlin

  

On Mon, 15 Feb 2021 at 13:39, Pavel Tupitsyn <[hidden email]> wrote:
Hi Charlin,

Most likely you should use a single TryGet [1] call instead of ContainsKey + Get,
it achieves the same logic more efficiently and without the risk of race conditions.

Looks like the key gets removed in between the ContainsKey and Get calls
by another thread / process / node.



On Mon, Feb 15, 2021 at 5:12 AM Ilya Kazakov <[hidden email]> wrote:
Hello, Charlin!

Could you show any reproducer, please?

------------------------
Thanks, Ilya!

пт, 12 февр. 2021 г. в 18:43, Charlin S <[hidden email]>:
Hi,
I am getting below error while running load test with ignite 2.9.1 but 
ContainsKey is successful and thereafter  Get by key is failed
The given key was not present in the cache: TestModel:HH|E6661DD9C3@$@@$@@$@(null)@$@@$@(null)@$@System.Collections.Generic.KeyNotFoundException: The given key was not present in the cache: testModel:HH|E6661DD9C3
   at Apache.Ignite.Core.Impl.Cache.CacheImpl`2.<>c__DisplayClass30.<Get>b__2f(IBinaryStream stream, Int64 res)
   at Apache.Ignite.Core.Impl.PlatformJniTarget.InStreamOutLong[TR](Int32 type, Func`2 outAction, Func`3 inAction, Func`2 readErrorAction)
   at Apache.Ignite.Core.Impl.Cache.CacheImpl`2.Get(TK key)

Code snippet:
image.png

Thanks & Regards,
Charlin