You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ignite.apache.org by Vladimir Steshin <vl...@gmail.com> on 2020/01/31 16:21:24 UTC

Question: Node filter for Lock/Semaphore

Folks, who knows if there are restrictions to add node filter for
distributed Semaphore/Lock? I want to suggest this feature.

I met a case in personal experience: some grid services were filtered by
nodes and launched over a logical sub-cluster. The services worked with
caches being held in the same sub-cluster: the caches had the same node
filter. I found that a distributed lock might be handy for the task I was
doing. A distributed lock using within these grid services. No matter what
the task was. It might be done without lock too. But I wandered I could not
place the lock in the same sub-cluster. Other nodes, outer to that
sub-cluster, should not held the lock at all.

It looks strange to me. I believe most object run over caches. Caches can
be configured with node filters. I think almost every object might be
filtered where to keep it.



Any ideas?

Re: Question: Node filter for Lock/Semaphore

Posted by Alexey Goncharuk <al...@gmail.com>.
Vladimir,

In theory, we can add node filter for the corresponding atomics system
cache in AtomicConfiguration. In practice, I do not see how this is useful
unless you limit the node filter to a single node. A lock/semaphore is
represented by a single cache key, so it cannot be collocated with more
than one node. In your example this would mean that all but one services
would work with a non-collocated instance of Lock. The difference would
become substantial if you used millions instances of Locks.

As a separate note - usually it's better off using pessimistic transactions
than locks for obvious reasons.

пт, 31 янв. 2020 г. в 19:21, Vladimir Steshin <vl...@gmail.com>:

> Folks, who knows if there are restrictions to add node filter for
> distributed Semaphore/Lock? I want to suggest this feature.
>
> I met a case in personal experience: some grid services were filtered by
> nodes and launched over a logical sub-cluster. The services worked with
> caches being held in the same sub-cluster: the caches had the same node
> filter. I found that a distributed lock might be handy for the task I was
> doing. A distributed lock using within these grid services. No matter what
> the task was. It might be done without lock too. But I wandered I could not
> place the lock in the same sub-cluster. Other nodes, outer to that
> sub-cluster, should not held the lock at all.
>
> It looks strange to me. I believe most object run over caches. Caches can
> be configured with node filters. I think almost every object might be
> filtered where to keep it.
>
>
>
> Any ideas?
>