[
https://issues.apache.org/jira/browse/GEODE-9268?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17493492#comment-17493492
]
ASF subversion and git services commented on GEODE-9268:
--------------------------------------------------------
Commit 7873837eeec67c9ae85d32f7165a7753d0c0cd27 in geode-native's branch
refs/heads/develop from Mario Salazar de Torres
[ https://gitbox.apache.org/repos/asf?p=geode-native.git;h=7873837 ]
GEODE-9268: Fix PdxInstance handling after cluster restart (#806)
* GEODE-9268: Fix PdxInstance handling after restart
- In scenarios where an PdxInstance is obtained and later used, it
might happen a coredump if the PdxTypeRegistry is cleaned up after the
PdxInstance is obtained. This happens on those scenarios where
redundancy is completly lost.
- This change refactors PdxInstance handling so in all cases, the PdxType
used is the one owned by the PdxInstance.
Whenever the PdxInstance is to be written, a check is executed to
ensure the cluster is aware of the PdxType and if not, register it.
- Removed PdxInstance serialization retries, as with the new approach
is not needed anymore.
- Removed UnknownPdxTypeException exception. Instead whenever a PdxType
is requested and not present, an IllegalStateException exception is
thrown, as it happens in the Java client.
- Now PdxInstance is not serialized whenever created. Instead, it's PDX
byte stream is generated on-demand. Note that the PdxInstance will be
serialized before being put into a server, as it was done before this
change.
- Fixed TcrMessage deserialization whenever a PdxType is requested by
its ID and no PdxType was found.
- Fixed incPdxInstanceCreations so it's incremented strictly whenver a
PdxInstance is created, and not whenever a PdxInstance is
deserialized.
- Fixed IT PdxTypeRegistry cleanupOnClusterRestart logic and renamed to
cleanupOnClusterRestartAndPut. This test was supposed to verify that
if a PdxInstance is created, and after that the cluster is restarted,
there is no coredump while writting it to a region. Instead it was
creating a PdxInstance before and after the cluster, but it has been
fixed to work as initially intended.
- Created a new IT PdxTypeRegistry cleanupOnClusterRestartAndFetchFields
to verify the issue described in the first bullet is not causing a coredump.
- Removed old IT testThinClientPdxInstance TS as there is a equivalent new
IT TS named PdxInstanceTest.
- Fixed some ITs to work accordingly the the new code.
- Fixed PdxInstanceImplTest.updatePdxStream to work accordingly with
the code changes.
* GEODE-9268: Revision 1
- Refactored member attributes for NestedPdxObject classes in order to
follow style guidelines.
- Refactored member attributes for PdxInstanceImpl class in order to
follow style guidelines.
- Moved default bytes variables from static to constants inside an anon
namespace within PdxInstanceImpl cpp file.
- Renamed 'pft' variables to 'field' inside PdxInstanceImpl in order to
make the code more readable.
- Changed return of PdxLocalWriter::getPdxStream to use the explicit
constructor of std::vector<uint8_t>
- Solved PdxInstanceTest.testNestedPdxInstance asserts description
mismatch.
- Used binary_semaphore inside PdxTypeRegistryTest insteda of an
in-place CacheListener in order to listener for cluster start/stop
events.
- Revert back changes to the OQL used inside
PdxTypeRegistryTest.cleanupOnClusterRestartAndPut
- Added test descriptions for both tests inside PdxTypeRegistryTest.
* GEODE-9268: Revision 2
- Addressed several others assert descriptions mismatch.
> Fix coredump whenever getFieldNames is called after a cluster restart
> ---------------------------------------------------------------------
>
> Key: GEODE-9268
> URL: https://issues.apache.org/jira/browse/GEODE-9268
> Project: Geode
> Issue Type: Bug
> Components: native client
> Reporter: Mario Salazar de Torres
> Assignee: Mario Salazar de Torres
> Priority: Major
> Labels: pull-request-available
>
> *WHEN* A PdxInstance is fetched from a region
> *AND* The whole cluster is restarted, triggering PdxTypeRegistry cleanup.
> *AND*Â getFieldNames is called on the PdxInstance created just before
> *THEN* a coredump happens.
> —
> *Additional information:*
> Callstack:
> {noformat}
> [ERROR 2021/05/05 12:57:12.781834 CEST main (139683590957120)] Segmentation
> fault happened
> 0# handler(int) at nc-pdx/main.cpp:225
> 1# 0x00007F0A9F5F13C0 in /lib/x86_64-linux-gnu/libpthread.so.0
> 2# apache::geode::client::PdxType::getPdxFieldTypes() const at
> cppcache/src/PdxType.hpp:181
> 3# apache::geode::client::PdxInstanceImpl::getFieldNames() at
> cppcache/src/PdxInstanceImpl.cpp:1383
> 4# main at nc-pdx/main.cpp:374
> 5# __libc_start_main in /lib/x86_64-linux-gnu/libc.so.6
> 6# _start in build/pdx{noformat}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)