[infinispan-dev] Bucket-based cache stores not removing buckets when they're empty

Sanne Grinovero sanne at infinispan.org
Tue Dec 6 05:28:59 EST 2011


Hi Martin,
I would expect that a bucket has a good likelihood to be reused, so
that performance would be better to avoid both deletion and subsequent
re-creation; concurrent creation might need a lock to ensure a single
instance is created, so that's not a very cheap operation.

That said, I don't know how bad situation can get in practice; are you
seeing this happening very often, to the point that many empty buckets
might become inefficient usage of space or indexes in the store ? We
might think of clearing them in background, but creation would need to
be a blocking operation.

Sanne

On 6 December 2011 09:35, Martin Gencur <mgencur at redhat.com> wrote:
> I found out through our tests that bucket-based cache stores
> (JdbcBinaryCacheStore and FileCacheStore) are not removing buckets (this
> is either a database table row or a file) when they remove last
> entry from the bucket and they remain empty in the database/filesystem.
>
> (https://github.com/infinispan/infinispan/blob/master/core/src/main/java/org/infinispan/loaders/bucket/BucketBasedCacheStore.java#L105)
>
> Buckets are removed only when the cache store is purged (purge
> attribute==true) so when the purge attribute is not set then the number
> of buckets will only grow.
>
> Shouldn't we change this to remove buckets when removing last entry from
> them?
>
>
> Thanks for any thoughts
>
>
>
> --
> Martin Gencur
> --
> JBoss QE, Enterprise Data Grid
> Desk phone: +420 532 294 192, ext. 62192
>
> _______________________________________________
> infinispan-dev mailing list
> infinispan-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/infinispan-dev


More information about the infinispan-dev mailing list