Reza Taroosheh created IGNITE-29292:
---------------------------------------
Summary: ATOMIC update of several keys leaves the backup without
written keys when the class registration on retry fails
Key: IGNITE-29292
URL: https://issues.apache.org/jira/browse/IGNITE-29292
Project: Ignite
Issue Type: Bug
Reporter: Reza Taroosheh
Assignee: Reza Taroosheh
Fix For: 2.20
In an ATOMIC cache, GridDhtAtomicCache.updateAllAsyncInternal0() catches
UnregisteredClassException from
update(), registers the class with BinaryContext.registerType(), and retries
the update from
dhtUpdRes.processedEntriesCount(). The keys before that index are already
written on the primary, and
their DHT update is kept in dhtUpdRes.dhtFuture() to be sent to the backups
after the retry.
If registerType() fails (for example, because the thread is interrupted while
it waits for the class name
registration), the error goes to the "catch (Throwable)" block of
updateAllAsyncInternal0(). It logs
"Unexpected exception during cache update", fails all keys of the request, and
returns before the DHT
future is mapped. So the keys already written on the primary are never sent to
the backups, and the
primary and the backups have different values.
The UnregisteredBinaryTypeException branch (BinaryContext.updateMetadata()) can
fail the same way.
Reproducer:
Two server nodes, ATOMIC cache with 1 backup and FULL_SYNC. A discovery hook
holds back
MappingAcceptedMessage, so the class name registration has to wait. On an
interrupted thread, invokeAll
on two keys of node 0: the entry processor sets 1 for the first key and a value
of a new class for the
second key.
Expected: either both keys are written on the primary and the backup, or none
of them; in any case the
primary and the backup have the same value of the first key.
Actual:
- invokeAll fails with CachePartialUpdateException for both keys;
- "Unexpected exception during cache update" is logged with
BinaryObjectException "Failed to register
class" from BinaryContext.registerType(), called from
updateAllAsyncInternal0(), caused by
IgniteInterruptedCheckedException;
- the primary has value 1 for the first key, the backup has none.
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)