[JBoss JIRA] (ISPN-3389) Forwarded transactions can remain stale after state transfer
by Mircea Markus (JIRA)
[ https://issues.jboss.org/browse/ISPN-3389?page=com.atlassian.jira.plugin.... ]
Mircea Markus updated ISPN-3389:
--------------------------------
Assignee: Dan Berindei (was: Mircea Markus)
> Forwarded transactions can remain stale after state transfer
> ------------------------------------------------------------
>
> Key: ISPN-3389
> URL: https://issues.jboss.org/browse/ISPN-3389
> Project: Infinispan
> Issue Type: Bug
> Components: State transfer
> Affects Versions: 5.2.7.Final
> Reporter: Erik Salter
> Assignee: Dan Berindei
>
> There is a scenario where a tx started on one node, moved during state transfer, and committed on the originating node won't be removed from the new owner's tx table.
> The chain of events is as follows:
> 1. New topology comes in as part of a view change.
> 2. Local transaction started with the new topology ID. This transaction was started due to a LockControlCommand and has no modifications. Also important, it only has local locks.
> 3. Tx forwarded to new owner before the local lock is acquired and registered with the transaction.
> 4. Since the tx has only local locks and no modifications, it is only removed locally. No TxCompletion or Rollback are broadcast to the new owners.
> This key becomes unusable not due to stale locks, but because the waitForTransaction() code will see that the old tx can "potentially" lock the key.
> This easily happens with pessimistic caches, though I have seen it happen with optimistic caches (there is a delta between the transaction being created and the lock registration).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 10 months
[JBoss JIRA] (ISPN-3405) Entries are passivated with wrong ID in DB
by Vitalii Chepeliuk (JIRA)
[ https://issues.jboss.org/browse/ISPN-3405?page=com.atlassian.jira.plugin.... ]
Vitalii Chepeliuk updated ISPN-3405:
------------------------------------
Description:
Entry passivation into DB, concretly this class LockSupportCacheStore and method store. Look at lines with <<< string for more info
{code:title=Bar.java|borderStyle=solid}
@Override
public final void store(InternalCacheEntry ed) throws CacheLoaderException {
if (trace) {
log.tracef("store(%s)", ed);
}
if (ed == null) {
return;
}
if (ed.canExpire() && ed.isExpired(timeService.wallClockTime())) {
if (containsKey(ed.getKey())) {
if (trace) {
log.tracef("Entry %s is expired! Removing!", ed);
}
remove(ed.getKey());
} else {
if (trace) {
log.tracef("Entry %s is expired! Not doing anything.", ed);
}
}
return;
}
L keyHashCode = getLockFromKey(ed.getKey()); <<< here key is generated like ed.getKey().hashCode() & 0xfffffc00;
lockForWriting(keyHashCode);
try {
storeLockSafe(ed, keyHashCode); <<< here it should be stored into Bucket and then stored in DB
} finally {
unlock(keyHashCode);
}
if (trace) {
log.tracef("exit store(%s)", ed);
}
}
{code}
When I use RemoteCacheManager and RemoteCache I am putting entries into cache
{code:title=Bar.java|borderStyle=solid}
cache.put("key1", "v1");
cache.put("key2", "v2");
cache.put("key3", "v3");
{code}
Then 2 entries are passivated and stored in DB
||ID||DATA||TIMESTAMP||
|183713792|0301fe032a01034c422b21033e286d7942657374506572736f6e616c4b657957686963684861734e657665724265656e426574746572420521033e02763203620003630000000000000002|-1|
|23486464|0301fe032a01034c420721033e046b657931420521033e02763103620003630000000000000001|-1|
IDs are generated from method above and
{code:title=Bar.java|borderStyle=solid}
byte[] keyBytes = marshaller.objectToByteBuffer("key1"); <<< key is marshalled
long keyID = ByteArrayEquivalence.INSTANCE.hashCode(keyBytes) & 0xfffffc00 //computation taken from BucketBasedCacheStore <<< this does not work for me
ode}
And next step I'd like to retrieve data from DB
SELECT ID, DATA FROM JDBC_BINARY_DEFAULT WHERE ID=keyID
But in method
{code:title=Bar.java|borderStyle=solid}
@Override
public Integer getLockFromKey(Object key) {
return key.hashCode() & 0xfffffc00; <<< here should be used Arrays.hashCode((byte[])key) & 0xfffffc00), if key is represented as byte array, or used ByteArrayEquivalence instead of simple byte array(byte[]) as argument
}
{code}
was:
Entry passivation into DB, concretly this class LockSupportCacheStore and method store
{code:title=Bar.java|borderStyle=solid}
@Override
public final void store(InternalCacheEntry ed) throws CacheLoaderException {
if (trace) {
log.tracef("store(%s)", ed);
}
if (ed == null) {
return;
}
if (ed.canExpire() && ed.isExpired(timeService.wallClockTime())) {
if (containsKey(ed.getKey())) {
if (trace) {
log.tracef("Entry %s is expired! Removing!", ed);
}
remove(ed.getKey());
} else {
if (trace) {
log.tracef("Entry %s is expired! Not doing anything.", ed);
}
}
return;
}
L keyHashCode = getLockFromKey(ed.getKey()); <<< here key is generated like ed.getKey().hashCode() & 0xfffffc00;
lockForWriting(keyHashCode);
try {
storeLockSafe(ed, keyHashCode); <<< here it should be stored into Bucket and then stored in DB
} finally {
unlock(keyHashCode);
}
if (trace) {
log.tracef("exit store(%s)", ed);
}
}
{code}
When I use RemoteCacheManager and RemoteCache I am putting entries into cache
{code:title=Bar.java|borderStyle=solid}
cache.put("key1", "v1");
cache.put("key2", "v2");
cache.put("key3", "v3");
{code}
Then 2 entries are passivated and stored in DB
||ID||DATA||TIMESTAMP||
|183713792|0301fe032a01034c422b21033e286d7942657374506572736f6e616c4b657957686963684861734e657665724265656e426574746572420521033e02763203620003630000000000000002|-1|
|23486464|0301fe032a01034c420721033e046b657931420521033e02763103620003630000000000000001|-1|
IDs are generated from method above and
{code:title=Bar.java|borderStyle=solid}
byte[] keyBytes = marshaller.objectToByteBuffer(key, 64); <<< data are marshalled
long keyID = ByteArrayEquivalence.INSTANCE.hashCode(keyBytes) & 0xfffffc00 //computation taken from BucketBasedCacheStore << this does not work for me
{code}
And next step I'd like to retrieve data from DB
SELECT ID, DATA FROM JDBC_BINARY_DEFAULT WHERE ID=keyID
But in method
{code:title=Bar.java|borderStyle=solid}
@Override
public Integer getLockFromKey(Object key) {
return key.hashCode() & 0xfffffc00; <<< here should be used Arrays.hashCode((byte[])key) & 0xfffffc00), if key is represented as byte array, or Used ByteArrayEquivalence instead of simple byte array(byte[]) as argument
}
{code}
> Entries are passivated with wrong ID in DB
> ------------------------------------------
>
> Key: ISPN-3405
> URL: https://issues.jboss.org/browse/ISPN-3405
> Project: Infinispan
> Issue Type: Bug
> Components: Eviction
> Affects Versions: 6.0.0.Alpha1
> Reporter: Vitalii Chepeliuk
> Assignee: Mircea Markus
>
> Entry passivation into DB, concretly this class LockSupportCacheStore and method store. Look at lines with <<< string for more info
> {code:title=Bar.java|borderStyle=solid}
> @Override
> public final void store(InternalCacheEntry ed) throws CacheLoaderException {
> if (trace) {
> log.tracef("store(%s)", ed);
> }
> if (ed == null) {
> return;
> }
> if (ed.canExpire() && ed.isExpired(timeService.wallClockTime())) {
> if (containsKey(ed.getKey())) {
> if (trace) {
> log.tracef("Entry %s is expired! Removing!", ed);
> }
> remove(ed.getKey());
> } else {
> if (trace) {
> log.tracef("Entry %s is expired! Not doing anything.", ed);
> }
> }
> return;
> }
> L keyHashCode = getLockFromKey(ed.getKey()); <<< here key is generated like ed.getKey().hashCode() & 0xfffffc00;
> lockForWriting(keyHashCode);
> try {
> storeLockSafe(ed, keyHashCode); <<< here it should be stored into Bucket and then stored in DB
> } finally {
> unlock(keyHashCode);
> }
> if (trace) {
> log.tracef("exit store(%s)", ed);
> }
> }
> {code}
> When I use RemoteCacheManager and RemoteCache I am putting entries into cache
> {code:title=Bar.java|borderStyle=solid}
> cache.put("key1", "v1");
> cache.put("key2", "v2");
> cache.put("key3", "v3");
> {code}
> Then 2 entries are passivated and stored in DB
> ||ID||DATA||TIMESTAMP||
> |183713792|0301fe032a01034c422b21033e286d7942657374506572736f6e616c4b657957686963684861734e657665724265656e426574746572420521033e02763203620003630000000000000002|-1|
> |23486464|0301fe032a01034c420721033e046b657931420521033e02763103620003630000000000000001|-1|
> IDs are generated from method above and
> {code:title=Bar.java|borderStyle=solid}
> byte[] keyBytes = marshaller.objectToByteBuffer("key1"); <<< key is marshalled
> long keyID = ByteArrayEquivalence.INSTANCE.hashCode(keyBytes) & 0xfffffc00 //computation taken from BucketBasedCacheStore <<< this does not work for me
> ode}
> And next step I'd like to retrieve data from DB
> SELECT ID, DATA FROM JDBC_BINARY_DEFAULT WHERE ID=keyID
> But in method
> {code:title=Bar.java|borderStyle=solid}
> @Override
> public Integer getLockFromKey(Object key) {
> return key.hashCode() & 0xfffffc00; <<< here should be used Arrays.hashCode((byte[])key) & 0xfffffc00), if key is represented as byte array, or used ByteArrayEquivalence instead of simple byte array(byte[]) as argument
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 10 months
[JBoss JIRA] (ISPN-3405) Entries are passivated with wrong ID in DB
by Vitalii Chepeliuk (JIRA)
[ https://issues.jboss.org/browse/ISPN-3405?page=com.atlassian.jira.plugin.... ]
Vitalii Chepeliuk updated ISPN-3405:
------------------------------------
Description:
Entry passivation into DB, concretly this class LockSupportCacheStore and method store. Look at lines with "<<<" string for more info
{code:title=Bar.java|borderStyle=solid}
@Override
public final void store(InternalCacheEntry ed) throws CacheLoaderException {
if (trace) {
log.tracef("store(%s)", ed);
}
if (ed == null) {
return;
}
if (ed.canExpire() && ed.isExpired(timeService.wallClockTime())) {
if (containsKey(ed.getKey())) {
if (trace) {
log.tracef("Entry %s is expired! Removing!", ed);
}
remove(ed.getKey());
} else {
if (trace) {
log.tracef("Entry %s is expired! Not doing anything.", ed);
}
}
return;
}
L keyHashCode = getLockFromKey(ed.getKey()); <<< here key is generated like ed.getKey().hashCode() & 0xfffffc00;
lockForWriting(keyHashCode);
try {
storeLockSafe(ed, keyHashCode); <<< here it should be stored into Bucket and then stored in DB
} finally {
unlock(keyHashCode);
}
if (trace) {
log.tracef("exit store(%s)", ed);
}
}
{code}
When I use RemoteCacheManager and RemoteCache I am putting entries into cache
{code:title=Bar.java|borderStyle=solid}
cache.put("key1", "v1");
cache.put("key2", "v2");
cache.put("key3", "v3");
{code}
Then 2 entries are passivated and stored in DB
||ID||DATA||TIMESTAMP||
|183713792|0301fe032a01034c422b21033e286d7942657374506572736f6e616c4b657957686963684861734e657665724265656e426574746572420521033e02763203620003630000000000000002|-1|
|23486464|0301fe032a01034c420721033e046b657931420521033e02763103620003630000000000000001|-1|
IDs are generated from method above and
{code:title=Bar.java|borderStyle=solid}
byte[] keyBytes = marshaller.objectToByteBuffer("key1"); <<< key is marshalled
long keyID = ByteArrayEquivalence.INSTANCE.hashCode(keyBytes) & 0xfffffc00 //computation taken from BucketBasedCacheStore <<< this does not work for me
ode}
And next step I'd like to retrieve data from DB
SELECT ID, DATA FROM JDBC_BINARY_DEFAULT WHERE ID=keyID
But in method
{code:title=Bar.java|borderStyle=solid}
@Override
public Integer getLockFromKey(Object key) {
return key.hashCode() & 0xfffffc00; <<< here should be used Arrays.hashCode((byte[])key) & 0xfffffc00), if key is represented as byte array, or used ByteArrayEquivalence instead of simple byte array(byte[]) as argument
}
{code}
was:
Entry passivation into DB, concretly this class LockSupportCacheStore and method store. Look at lines with <<< string for more info
{code:title=Bar.java|borderStyle=solid}
@Override
public final void store(InternalCacheEntry ed) throws CacheLoaderException {
if (trace) {
log.tracef("store(%s)", ed);
}
if (ed == null) {
return;
}
if (ed.canExpire() && ed.isExpired(timeService.wallClockTime())) {
if (containsKey(ed.getKey())) {
if (trace) {
log.tracef("Entry %s is expired! Removing!", ed);
}
remove(ed.getKey());
} else {
if (trace) {
log.tracef("Entry %s is expired! Not doing anything.", ed);
}
}
return;
}
L keyHashCode = getLockFromKey(ed.getKey()); <<< here key is generated like ed.getKey().hashCode() & 0xfffffc00;
lockForWriting(keyHashCode);
try {
storeLockSafe(ed, keyHashCode); <<< here it should be stored into Bucket and then stored in DB
} finally {
unlock(keyHashCode);
}
if (trace) {
log.tracef("exit store(%s)", ed);
}
}
{code}
When I use RemoteCacheManager and RemoteCache I am putting entries into cache
{code:title=Bar.java|borderStyle=solid}
cache.put("key1", "v1");
cache.put("key2", "v2");
cache.put("key3", "v3");
{code}
Then 2 entries are passivated and stored in DB
||ID||DATA||TIMESTAMP||
|183713792|0301fe032a01034c422b21033e286d7942657374506572736f6e616c4b657957686963684861734e657665724265656e426574746572420521033e02763203620003630000000000000002|-1|
|23486464|0301fe032a01034c420721033e046b657931420521033e02763103620003630000000000000001|-1|
IDs are generated from method above and
{code:title=Bar.java|borderStyle=solid}
byte[] keyBytes = marshaller.objectToByteBuffer("key1"); <<< key is marshalled
long keyID = ByteArrayEquivalence.INSTANCE.hashCode(keyBytes) & 0xfffffc00 //computation taken from BucketBasedCacheStore <<< this does not work for me
ode}
And next step I'd like to retrieve data from DB
SELECT ID, DATA FROM JDBC_BINARY_DEFAULT WHERE ID=keyID
But in method
{code:title=Bar.java|borderStyle=solid}
@Override
public Integer getLockFromKey(Object key) {
return key.hashCode() & 0xfffffc00; <<< here should be used Arrays.hashCode((byte[])key) & 0xfffffc00), if key is represented as byte array, or used ByteArrayEquivalence instead of simple byte array(byte[]) as argument
}
{code}
> Entries are passivated with wrong ID in DB
> ------------------------------------------
>
> Key: ISPN-3405
> URL: https://issues.jboss.org/browse/ISPN-3405
> Project: Infinispan
> Issue Type: Bug
> Components: Eviction
> Affects Versions: 6.0.0.Alpha1
> Reporter: Vitalii Chepeliuk
> Assignee: Mircea Markus
>
> Entry passivation into DB, concretly this class LockSupportCacheStore and method store. Look at lines with "<<<" string for more info
> {code:title=Bar.java|borderStyle=solid}
> @Override
> public final void store(InternalCacheEntry ed) throws CacheLoaderException {
> if (trace) {
> log.tracef("store(%s)", ed);
> }
> if (ed == null) {
> return;
> }
> if (ed.canExpire() && ed.isExpired(timeService.wallClockTime())) {
> if (containsKey(ed.getKey())) {
> if (trace) {
> log.tracef("Entry %s is expired! Removing!", ed);
> }
> remove(ed.getKey());
> } else {
> if (trace) {
> log.tracef("Entry %s is expired! Not doing anything.", ed);
> }
> }
> return;
> }
> L keyHashCode = getLockFromKey(ed.getKey()); <<< here key is generated like ed.getKey().hashCode() & 0xfffffc00;
> lockForWriting(keyHashCode);
> try {
> storeLockSafe(ed, keyHashCode); <<< here it should be stored into Bucket and then stored in DB
> } finally {
> unlock(keyHashCode);
> }
> if (trace) {
> log.tracef("exit store(%s)", ed);
> }
> }
> {code}
> When I use RemoteCacheManager and RemoteCache I am putting entries into cache
> {code:title=Bar.java|borderStyle=solid}
> cache.put("key1", "v1");
> cache.put("key2", "v2");
> cache.put("key3", "v3");
> {code}
> Then 2 entries are passivated and stored in DB
> ||ID||DATA||TIMESTAMP||
> |183713792|0301fe032a01034c422b21033e286d7942657374506572736f6e616c4b657957686963684861734e657665724265656e426574746572420521033e02763203620003630000000000000002|-1|
> |23486464|0301fe032a01034c420721033e046b657931420521033e02763103620003630000000000000001|-1|
> IDs are generated from method above and
> {code:title=Bar.java|borderStyle=solid}
> byte[] keyBytes = marshaller.objectToByteBuffer("key1"); <<< key is marshalled
> long keyID = ByteArrayEquivalence.INSTANCE.hashCode(keyBytes) & 0xfffffc00 //computation taken from BucketBasedCacheStore <<< this does not work for me
> ode}
> And next step I'd like to retrieve data from DB
> SELECT ID, DATA FROM JDBC_BINARY_DEFAULT WHERE ID=keyID
> But in method
> {code:title=Bar.java|borderStyle=solid}
> @Override
> public Integer getLockFromKey(Object key) {
> return key.hashCode() & 0xfffffc00; <<< here should be used Arrays.hashCode((byte[])key) & 0xfffffc00), if key is represented as byte array, or used ByteArrayEquivalence instead of simple byte array(byte[]) as argument
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 10 months
[JBoss JIRA] (ISPN-3405) Entries are passivated with wrong ID in DB
by Vitalii Chepeliuk (JIRA)
[ https://issues.jboss.org/browse/ISPN-3405?page=com.atlassian.jira.plugin.... ]
Vitalii Chepeliuk updated ISPN-3405:
------------------------------------
Description:
Entry passivation into DB, concretly this class LockSupportCacheStore and method store
{code:title=Bar.java|borderStyle=solid}
@Override
public final void store(InternalCacheEntry ed) throws CacheLoaderException {
if (trace) {
log.tracef("store(%s)", ed);
}
if (ed == null) {
return;
}
if (ed.canExpire() && ed.isExpired(timeService.wallClockTime())) {
if (containsKey(ed.getKey())) {
if (trace) {
log.tracef("Entry %s is expired! Removing!", ed);
}
remove(ed.getKey());
} else {
if (trace) {
log.tracef("Entry %s is expired! Not doing anything.", ed);
}
}
return;
}
L keyHashCode = getLockFromKey(ed.getKey()); <<< here key is generated like ed.getKey().hashCode() & 0xfffffc00;
lockForWriting(keyHashCode);
try {
storeLockSafe(ed, keyHashCode); <<< here it should be stored into Bucket and then stored in DB
} finally {
unlock(keyHashCode);
}
if (trace) {
log.tracef("exit store(%s)", ed);
}
}
{code}
When I use RemoteCacheManager and RemoteCache I am putting entries into cache
{code:title=Bar.java|borderStyle=solid}
cache.put("key1", "v1");
cache.put("key2", "v2");
cache.put("key3", "v3");
{code}
Then 2 entries are passivated and stored in DB
||ID||DATA||TIMESTAMP||
|183713792|0301fe032a01034c422b21033e286d7942657374506572736f6e616c4b657957686963684861734e657665724265656e426574746572420521033e02763203620003630000000000000002|-1|
|23486464|0301fe032a01034c420721033e046b657931420521033e02763103620003630000000000000001|-1|
IDs are generated from method above and
{code:title=Bar.java|borderStyle=solid}
byte[] keyBytes = marshaller.objectToByteBuffer(key, 64); <<< data are marshalled
long keyID = ByteArrayEquivalence.INSTANCE.hashCode(keyBytes) & 0xfffffc00 //computation taken from BucketBasedCacheStore << this does not work for me
{code}
And next step I'd like to retrieve data from DB
SELECT ID, DATA FROM JDBC_BINARY_DEFAULT WHERE ID=keyID
But in method
{code:title=Bar.java|borderStyle=solid}
@Override
public Integer getLockFromKey(Object key) {
return key.hashCode() & 0xfffffc00; <<< here should be used Arrays.hashCode((byte[])key) & 0xfffffc00), if key is represented as byte array, or Used ByteArrayEquivalence instead of simple byte array(byte[]) as argument
}
{code}
was:
Entry passivation into DB, concretly this class LockSupportCacheStore and method store
{code:title=Bar.java|borderStyle=solid}
@Override
public final void store(InternalCacheEntry ed) throws CacheLoaderException {
if (trace) {
log.tracef("store(%s)", ed);
}
if (ed == null) {
return;
}
if (ed.canExpire() && ed.isExpired(timeService.wallClockTime())) {
if (containsKey(ed.getKey())) {
if (trace) {
log.tracef("Entry %s is expired! Removing!", ed);
}
remove(ed.getKey());
} else {
if (trace) {
log.tracef("Entry %s is expired! Not doing anything.", ed);
}
}
return;
}
L keyHashCode = getLockFromKey(ed.getKey()); <<< here key is generated like ed.getKey().hashCode() & 0xfffffc00;
lockForWriting(keyHashCode);
try {
storeLockSafe(ed, keyHashCode); <<< here it should be stored into Bucket and then stored in DB
} finally {
unlock(keyHashCode);
}
if (trace) {
log.tracef("exit store(%s)", ed);
}
}
{code}
When I use RemoteCacheManager and RemoteCache I am putting entries into cache
{code:title=Bar.java|borderStyle=solid}
cache.put("key1", "v1");
cache.put("key2", "v2");
cache.put("key3", "v3");
{code}
Then 2 entries are passivated and stored in DB
ID DATA VERSION
183713792 0301fe032a01034c422b21033e286d7942657374506572736f6e616c4b657957686963684861734e657665724265656e426574746572420521033e02763203620003630000000000000002 -1
23486464 0301fe032a01034c420721033e046b657931420521033e02763103620003630000000000000001 -1
IDs are generated from method above and
{code:title=Bar.java|borderStyle=solid}
byte[] keyBytes = marshaller.objectToByteBuffer(key, 64); <<< data are marshalled
long keyID = ByteArrayEquivalence.INSTANCE.hashCode(keyBytes) & 0xfffffc00 //computation taken from BucketBasedCacheStore << this does not work for me
{code}
And next step I'd like to retrieve data from DB
SELECT ID, DATA FROM JDBC_BINARY_DEFAULT WHERE ID=keyID
But in method
{code:title=Bar.java|borderStyle=solid}
@Override
public Integer getLockFromKey(Object key) {
return key.hashCode() & 0xfffffc00; <<< here should be used Arrays.hashCode((byte[])key) & 0xfffffc00), if key is represented as byte array, or Used ByteArrayEquivalence instead of simple byte array(byte[]) as argument
}
{code}
> Entries are passivated with wrong ID in DB
> ------------------------------------------
>
> Key: ISPN-3405
> URL: https://issues.jboss.org/browse/ISPN-3405
> Project: Infinispan
> Issue Type: Bug
> Components: Eviction
> Affects Versions: 6.0.0.Alpha1
> Reporter: Vitalii Chepeliuk
> Assignee: Mircea Markus
>
> Entry passivation into DB, concretly this class LockSupportCacheStore and method store
> {code:title=Bar.java|borderStyle=solid}
> @Override
> public final void store(InternalCacheEntry ed) throws CacheLoaderException {
> if (trace) {
> log.tracef("store(%s)", ed);
> }
> if (ed == null) {
> return;
> }
> if (ed.canExpire() && ed.isExpired(timeService.wallClockTime())) {
> if (containsKey(ed.getKey())) {
> if (trace) {
> log.tracef("Entry %s is expired! Removing!", ed);
> }
> remove(ed.getKey());
> } else {
> if (trace) {
> log.tracef("Entry %s is expired! Not doing anything.", ed);
> }
> }
> return;
> }
> L keyHashCode = getLockFromKey(ed.getKey()); <<< here key is generated like ed.getKey().hashCode() & 0xfffffc00;
> lockForWriting(keyHashCode);
> try {
> storeLockSafe(ed, keyHashCode); <<< here it should be stored into Bucket and then stored in DB
> } finally {
> unlock(keyHashCode);
> }
> if (trace) {
> log.tracef("exit store(%s)", ed);
> }
> }
> {code}
> When I use RemoteCacheManager and RemoteCache I am putting entries into cache
> {code:title=Bar.java|borderStyle=solid}
> cache.put("key1", "v1");
> cache.put("key2", "v2");
> cache.put("key3", "v3");
> {code}
> Then 2 entries are passivated and stored in DB
> ||ID||DATA||TIMESTAMP||
> |183713792|0301fe032a01034c422b21033e286d7942657374506572736f6e616c4b657957686963684861734e657665724265656e426574746572420521033e02763203620003630000000000000002|-1|
> |23486464|0301fe032a01034c420721033e046b657931420521033e02763103620003630000000000000001|-1|
> IDs are generated from method above and
> {code:title=Bar.java|borderStyle=solid}
> byte[] keyBytes = marshaller.objectToByteBuffer(key, 64); <<< data are marshalled
> long keyID = ByteArrayEquivalence.INSTANCE.hashCode(keyBytes) & 0xfffffc00 //computation taken from BucketBasedCacheStore << this does not work for me
> {code}
> And next step I'd like to retrieve data from DB
> SELECT ID, DATA FROM JDBC_BINARY_DEFAULT WHERE ID=keyID
> But in method
> {code:title=Bar.java|borderStyle=solid}
> @Override
> public Integer getLockFromKey(Object key) {
> return key.hashCode() & 0xfffffc00; <<< here should be used Arrays.hashCode((byte[])key) & 0xfffffc00), if key is represented as byte array, or Used ByteArrayEquivalence instead of simple byte array(byte[]) as argument
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 10 months
[JBoss JIRA] (ISPN-3405) Entries are passivated with wrong ID in DB
by Vitalii Chepeliuk (JIRA)
[ https://issues.jboss.org/browse/ISPN-3405?page=com.atlassian.jira.plugin.... ]
Vitalii Chepeliuk updated ISPN-3405:
------------------------------------
Description:
Entry passivation into DB, concretly this class LockSupportCacheStore and method store
{code:title=Bar.java|borderStyle=solid}
@Override
public final void store(InternalCacheEntry ed) throws CacheLoaderException {
if (trace) {
log.tracef("store(%s)", ed);
}
if (ed == null) {
return;
}
if (ed.canExpire() && ed.isExpired(timeService.wallClockTime())) {
if (containsKey(ed.getKey())) {
if (trace) {
log.tracef("Entry %s is expired! Removing!", ed);
}
remove(ed.getKey());
} else {
if (trace) {
log.tracef("Entry %s is expired! Not doing anything.", ed);
}
}
return;
}
L keyHashCode = getLockFromKey(ed.getKey()); <<< here key is generated like ed.getKey().hashCode() & 0xfffffc00;
lockForWriting(keyHashCode);
try {
storeLockSafe(ed, keyHashCode); <<< here it should be stored into Bucket and then stored in DB
} finally {
unlock(keyHashCode);
}
if (trace) {
log.tracef("exit store(%s)", ed);
}
}
{code}
When I use RemoteCacheManager and RemoteCache I am putting entries into cache
{code:title=Bar.java|borderStyle=solid}
cache.put("key1", "v1");
cache.put("key2", "v2");
cache.put("key3", "v3");
{code}
Then 2 entries are passivated and stored in DB
ID DATA VERSION
183713792 0301fe032a01034c422b21033e286d7942657374506572736f6e616c4b657957686963684861734e657665724265656e426574746572420521033e02763203620003630000000000000002 -1
23486464 0301fe032a01034c420721033e046b657931420521033e02763103620003630000000000000001 -1
IDs are generated from method above and
{code:title=Bar.java|borderStyle=solid}
byte[] keyBytes = marshaller.objectToByteBuffer(key, 64); <<< data are marshalled
long keyID = ByteArrayEquivalence.INSTANCE.hashCode(keyBytes) & 0xfffffc00 //computation taken from BucketBasedCacheStore << this does not work for me
{code}
And next step I'd like to retrieve data from DB
SELECT ID, DATA FROM JDBC_BINARY_DEFAULT WHERE ID=keyID
But in method
{code:title=Bar.java|borderStyle=solid}
@Override
public Integer getLockFromKey(Object key) {
return key.hashCode() & 0xfffffc00; <<< here should be used Arrays.hashCode((byte[])key) & 0xfffffc00), if key is represented as byte array, or Used ByteArrayEquivalence instead of simple byte array(byte[]) as argument
}
{code}
was:
Entry passivation into DB, concretly this class LockSupportCacheStore and method store
@Override
public final void store(InternalCacheEntry ed) throws CacheLoaderException {
if (trace) {
log.tracef("store(%s)", ed);
}
if (ed == null) {
return;
}
if (ed.canExpire() && ed.isExpired(timeService.wallClockTime())) {
if (containsKey(ed.getKey())) {
if (trace) {
log.tracef("Entry %s is expired! Removing!", ed);
}
remove(ed.getKey());
} else {
if (trace) {
log.tracef("Entry %s is expired! Not doing anything.", ed);
}
}
return;
}
L keyHashCode = getLockFromKey(ed.getKey()); <<< here key is generated like ed.getKey().hashCode() & 0xfffffc00;
lockForWriting(keyHashCode);
try {
storeLockSafe(ed, keyHashCode); <<< here it should be stored into Bucket and then stored in DB
} finally {
unlock(keyHashCode);
}
if (trace) {
log.tracef("exit store(%s)", ed);
}
}
When I use RemoteCacheManager and RemoteCache I am putting entries into cache
cache.put("key1", "v1");
cache.put("key2", "v2");
cache.put("key3", "v3");
Then 2 entries are passivated and stored in DB
ID DATA VERSION
183713792 0301fe032a01034c422b21033e286d7942657374506572736f6e616c4b657957686963684861734e657665724265656e426574746572420521033e02763203620003630000000000000002 -1
23486464 0301fe032a01034c420721033e046b657931420521033e02763103620003630000000000000001 -1
IDs are generated from method above and
byte[] keyBytes = marshaller.objectToByteBuffer(key, 64); <<< data are marshalled
long keyID = ByteArrayEquivalence.INSTANCE.hashCode(keyBytes) & 0xfffffc00 //computation taken from BucketBasedCacheStore << this does not work for me
And next step I'd like to retrieve data from DB
SELECT ID, DATA FROM JDBC_BINARY_DEFAULT WHERE ID=keyID
But in method
@Override
public Integer getLockFromKey(Object key) {
return key.hashCode() & 0xfffffc00; <<< here should be used Arrays.hashCode((byte[])key) & 0xfffffc00), if key is represented as byte array, or Used ByteArrayEquivalence instead of simple byte array(byte[]) as argument
}
> Entries are passivated with wrong ID in DB
> ------------------------------------------
>
> Key: ISPN-3405
> URL: https://issues.jboss.org/browse/ISPN-3405
> Project: Infinispan
> Issue Type: Bug
> Components: Eviction
> Affects Versions: 6.0.0.Alpha1
> Reporter: Vitalii Chepeliuk
> Assignee: Mircea Markus
>
> Entry passivation into DB, concretly this class LockSupportCacheStore and method store
> {code:title=Bar.java|borderStyle=solid}
> @Override
> public final void store(InternalCacheEntry ed) throws CacheLoaderException {
> if (trace) {
> log.tracef("store(%s)", ed);
> }
> if (ed == null) {
> return;
> }
> if (ed.canExpire() && ed.isExpired(timeService.wallClockTime())) {
> if (containsKey(ed.getKey())) {
> if (trace) {
> log.tracef("Entry %s is expired! Removing!", ed);
> }
> remove(ed.getKey());
> } else {
> if (trace) {
> log.tracef("Entry %s is expired! Not doing anything.", ed);
> }
> }
> return;
> }
> L keyHashCode = getLockFromKey(ed.getKey()); <<< here key is generated like ed.getKey().hashCode() & 0xfffffc00;
> lockForWriting(keyHashCode);
> try {
> storeLockSafe(ed, keyHashCode); <<< here it should be stored into Bucket and then stored in DB
> } finally {
> unlock(keyHashCode);
> }
> if (trace) {
> log.tracef("exit store(%s)", ed);
> }
> }
> {code}
> When I use RemoteCacheManager and RemoteCache I am putting entries into cache
> {code:title=Bar.java|borderStyle=solid}
> cache.put("key1", "v1");
> cache.put("key2", "v2");
> cache.put("key3", "v3");
> {code}
> Then 2 entries are passivated and stored in DB
> ID DATA VERSION
> 183713792 0301fe032a01034c422b21033e286d7942657374506572736f6e616c4b657957686963684861734e657665724265656e426574746572420521033e02763203620003630000000000000002 -1
> 23486464 0301fe032a01034c420721033e046b657931420521033e02763103620003630000000000000001 -1
> IDs are generated from method above and
> {code:title=Bar.java|borderStyle=solid}
> byte[] keyBytes = marshaller.objectToByteBuffer(key, 64); <<< data are marshalled
> long keyID = ByteArrayEquivalence.INSTANCE.hashCode(keyBytes) & 0xfffffc00 //computation taken from BucketBasedCacheStore << this does not work for me
> {code}
> And next step I'd like to retrieve data from DB
> SELECT ID, DATA FROM JDBC_BINARY_DEFAULT WHERE ID=keyID
> But in method
> {code:title=Bar.java|borderStyle=solid}
> @Override
> public Integer getLockFromKey(Object key) {
> return key.hashCode() & 0xfffffc00; <<< here should be used Arrays.hashCode((byte[])key) & 0xfffffc00), if key is represented as byte array, or Used ByteArrayEquivalence instead of simple byte array(byte[]) as argument
> }
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 10 months
[JBoss JIRA] (ISPN-3405) Entries are passivated with wrong ID in DB
by Vitalii Chepeliuk (JIRA)
Vitalii Chepeliuk created ISPN-3405:
---------------------------------------
Summary: Entries are passivated with wrong ID in DB
Key: ISPN-3405
URL: https://issues.jboss.org/browse/ISPN-3405
Project: Infinispan
Issue Type: Bug
Components: Eviction
Affects Versions: 6.0.0.Alpha1
Reporter: Vitalii Chepeliuk
Assignee: Mircea Markus
Entry passivation into DB, concretly this class LockSupportCacheStore and method store
@Override
public final void store(InternalCacheEntry ed) throws CacheLoaderException {
if (trace) {
log.tracef("store(%s)", ed);
}
if (ed == null) {
return;
}
if (ed.canExpire() && ed.isExpired(timeService.wallClockTime())) {
if (containsKey(ed.getKey())) {
if (trace) {
log.tracef("Entry %s is expired! Removing!", ed);
}
remove(ed.getKey());
} else {
if (trace) {
log.tracef("Entry %s is expired! Not doing anything.", ed);
}
}
return;
}
L keyHashCode = getLockFromKey(ed.getKey()); <<< here key is generated like ed.getKey().hashCode() & 0xfffffc00;
lockForWriting(keyHashCode);
try {
storeLockSafe(ed, keyHashCode); <<< here it should be stored into Bucket and then stored in DB
} finally {
unlock(keyHashCode);
}
if (trace) {
log.tracef("exit store(%s)", ed);
}
}
When I use RemoteCacheManager and RemoteCache I am putting entries into cache
cache.put("key1", "v1");
cache.put("key2", "v2");
cache.put("key3", "v3");
Then 2 entries are passivated and stored in DB
ID DATA VERSION
183713792 0301fe032a01034c422b21033e286d7942657374506572736f6e616c4b657957686963684861734e657665724265656e426574746572420521033e02763203620003630000000000000002 -1
23486464 0301fe032a01034c420721033e046b657931420521033e02763103620003630000000000000001 -1
IDs are generated from method above and
byte[] keyBytes = marshaller.objectToByteBuffer(key, 64); <<< data are marshalled
long keyID = ByteArrayEquivalence.INSTANCE.hashCode(keyBytes) & 0xfffffc00 //computation taken from BucketBasedCacheStore << this does not work for me
And next step I'd like to retrieve data from DB
SELECT ID, DATA FROM JDBC_BINARY_DEFAULT WHERE ID=keyID
But in method
@Override
public Integer getLockFromKey(Object key) {
return key.hashCode() & 0xfffffc00; <<< here should be used Arrays.hashCode((byte[])key) & 0xfffffc00), if key is represented as byte array, or Used ByteArrayEquivalence instead of simple byte array(byte[]) as argument
}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 10 months
[JBoss JIRA] (ISPN-3323) Update Hotrod client version number
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/ISPN-3323?page=com.atlassian.jira.plugin.... ]
RH Bugzilla Integration commented on ISPN-3323:
-----------------------------------------------
Jakub Markos <jmarkos(a)redhat.com> changed the Status of [bug 987526|https://bugzilla.redhat.com/show_bug.cgi?id=987526] from ASSIGNED to VERIFIED
> Update Hotrod client version number
> -----------------------------------
>
> Key: ISPN-3323
> URL: https://issues.jboss.org/browse/ISPN-3323
> Project: Infinispan
> Issue Type: Task
> Components: Remote protocols
> Affects Versions: 5.3.0.Final
> Reporter: Dan Berindei
> Assignee: Tristan Tarrant
> Fix For: 6.0.0.Final
>
>
> {{BasicCache.getVersion()}} is documented to return "the version of Infinispan", but {{RemoteCacheImpl.getVersion()}} returns {{Version.getProtocolVersion()}} (which is {{"1.0"}}).
> I think there should be a separate method to return the protocol version, and {{RemoteCacheImpl.getVersion()}} should return the Infinispan version (with a hook in the release script to update it automatically).
> {{Version.getProtocolVersion()}} should also be updated to {{"1.2"}}.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 10 months
[JBoss JIRA] (ISPN-3323) Update Hotrod client version number
by RH Bugzilla Integration (JIRA)
[ https://issues.jboss.org/browse/ISPN-3323?page=com.atlassian.jira.plugin.... ]
RH Bugzilla Integration commented on ISPN-3323:
-----------------------------------------------
Jakub Markos <jmarkos(a)redhat.com> made a comment on [bug 987526|https://bugzilla.redhat.com/show_bug.cgi?id=987526]
Fixed in 6.2.0.DR2.
> Update Hotrod client version number
> -----------------------------------
>
> Key: ISPN-3323
> URL: https://issues.jboss.org/browse/ISPN-3323
> Project: Infinispan
> Issue Type: Task
> Components: Remote protocols
> Affects Versions: 5.3.0.Final
> Reporter: Dan Berindei
> Assignee: Tristan Tarrant
> Fix For: 6.0.0.Final
>
>
> {{BasicCache.getVersion()}} is documented to return "the version of Infinispan", but {{RemoteCacheImpl.getVersion()}} returns {{Version.getProtocolVersion()}} (which is {{"1.0"}}).
> I think there should be a separate method to return the protocol version, and {{RemoteCacheImpl.getVersion()}} should return the Infinispan version (with a hook in the release script to update it automatically).
> {{Version.getProtocolVersion()}} should also be updated to {{"1.2"}}.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 10 months
[JBoss JIRA] (ISPN-3366) Data loss when entry forwarding to primary owner and primary owner shutdown
by Dan Berindei (JIRA)
[ https://issues.jboss.org/browse/ISPN-3366?page=com.atlassian.jira.plugin.... ]
Dan Berindei updated ISPN-3366:
-------------------------------
Status: Resolved (was: Pull Request Sent)
Resolution: Done
I integrated the fix both in master and in 5.2.x.
Regular put commands should be ok now, but putIfAbsent commands may still end up with insufficient owners in certain situations.
> Data loss when entry forwarding to primary owner and primary owner shutdown
> ---------------------------------------------------------------------------
>
> Key: ISPN-3366
> URL: https://issues.jboss.org/browse/ISPN-3366
> Project: Infinispan
> Issue Type: Bug
> Components: Distributed Cache
> Affects Versions: 5.2.4.Final, 6.0.0.Alpha1
> Reporter: Takayoshi Kimura
> Assignee: Dan Berindei
> Priority: Critical
> Fix For: 5.2.8.Final, 6.0.0.Alpha3, 6.0.0.Final
>
> Attachments: ISPN-3366-full-logs-3rd.zip, ISPN-3366-full-logs-4th.zip, ISPN-3366-logs.zip
>
>
> Looks like a problem in entry forwarding.
> Here is test scenario:
> * DIST numOwners=2, start with 4 nodes cluster then normal shutdown 1 node during load
> * HotRod putIfAbsent accesses from 40 threads (1 process, 1 remote cache instance), 40000 entries total
> After the test run, the numberOfEntries on each node are:
> * node1: 26608
> * node2: 26622
> * node3: 26746
> * node4: 0
> Total is 79976 and HotRod client received 11 errors, so 79976 + (11 * 2) = 79998. It means 1 entry is completely missing.
> Let's take a look at the missing entry, hash(thread16key59) = 574ff563.
> Current CH: owners(574ff563) are [node4, node1]
> The events sequence is:
> * hotrod -> node1
> * node1 forwarding it to primary owner node4
> * node4 doesn't process the forwarded entry, shutdown
> Result owners(7c29bccb) is [] empty. This entry is completely lost without any errors.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 10 months
[JBoss JIRA] (ISPN-3366) Data loss when entry forwarding to primary owner and primary owner shutdown
by Dan Berindei (JIRA)
[ https://issues.jboss.org/browse/ISPN-3366?page=com.atlassian.jira.plugin.... ]
Dan Berindei updated ISPN-3366:
-------------------------------
Status: Pull Request Sent (was: Reopened)
Git Pull Request: https://github.com/infinispan/infinispan/pull/1995, https://github.com/infinispan/infinispan/pull/2003 (was: https://github.com/infinispan/infinispan/pull/1995)
> Data loss when entry forwarding to primary owner and primary owner shutdown
> ---------------------------------------------------------------------------
>
> Key: ISPN-3366
> URL: https://issues.jboss.org/browse/ISPN-3366
> Project: Infinispan
> Issue Type: Bug
> Components: Distributed Cache
> Affects Versions: 5.2.4.Final, 6.0.0.Alpha1
> Reporter: Takayoshi Kimura
> Assignee: Dan Berindei
> Priority: Critical
> Fix For: 5.2.8.Final, 6.0.0.Alpha3, 6.0.0.Final
>
> Attachments: ISPN-3366-full-logs-3rd.zip, ISPN-3366-full-logs-4th.zip, ISPN-3366-logs.zip
>
>
> Looks like a problem in entry forwarding.
> Here is test scenario:
> * DIST numOwners=2, start with 4 nodes cluster then normal shutdown 1 node during load
> * HotRod putIfAbsent accesses from 40 threads (1 process, 1 remote cache instance), 40000 entries total
> After the test run, the numberOfEntries on each node are:
> * node1: 26608
> * node2: 26622
> * node3: 26746
> * node4: 0
> Total is 79976 and HotRod client received 11 errors, so 79976 + (11 * 2) = 79998. It means 1 entry is completely missing.
> Let's take a look at the missing entry, hash(thread16key59) = 574ff563.
> Current CH: owners(574ff563) are [node4, node1]
> The events sequence is:
> * hotrod -> node1
> * node1 forwarding it to primary owner node4
> * node4 doesn't process the forwarded entry, shutdown
> Result owners(7c29bccb) is [] empty. This entry is completely lost without any errors.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
10 years, 10 months