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.
20 files changed
tree: 3605234e6435c06c093ea9f7bb9c9545ebe4cfad
  1. c-bindings/
  2. ci/
  3. clicache/
  4. cmake/
  5. cppcache/
  6. defaultSystem/
  7. dependencies/
  8. dist/
  9. docker/
  10. docs/
  11. etc/
  12. examples/
  13. executables/
  14. netcore/
  15. packer/
  16. sni-test-config/
  17. sqliteimpl/
  18. ssl_keys/
  19. templates/
  20. tests/
  21. tools/
  22. xsds/
  23. .asf.yaml
  24. .clang-format
  25. .clang-tidy
  26. .cpackignore
  27. .gitignore
  28. .lcovrc
  29. .lgtm.yml
  30. .ratignore
  31. BUILDING.md
  32. CMakeLists.txt
  33. CONTRIBUTING.md
  34. FindNativeClient.cmake
  35. FindNativeClientCPPCache.cmake
  36. LICENSE
  37. NOTICE
  38. README.md
README.md

Apache Geode

Build Status License LGTM Total Alerts Language grade: C/C++ Language grade: C# Language grade: JavaScript

Table of Contents

Overview

Native Client is a client implementation for Apache Geode that does not require the Java server JARs.

Building from Source

Directions to build Native Client from source can be found in the source distribution in BUILDING.md.

Application Development

Native Client applications can be written in these client technologies:

Versioning

Geode Native follows the Semantic Versioning 2.0.0 specification (semver). This specification only addresses the API compatibility with libraries and does not cover ABI compatibility.

C++

ABI compatibility is not preserved similarly to the API compatibility. ABI compatibility is only guaranteed between patch releases. Recompilation is required for both minor and major releases.

.NET

ABI compatibility is preserved similarly to the API compatibility. ABI compatibility is guaranteed between patch and minor releases. Recompilation is only require for major releases or to utilize new APIs added in minor releases.

Export Control

This distribution includes cryptographic software. The country in which you currently reside may have restrictions on the import, possession, use, and/or re-export to another country, of encryption software. BEFORE using any encryption software, please check your country's laws, regulations and policies concerning the import, possession, or use, and re-export of encryption software, to see if this is permitted. See http://www.wassenaar.org/ for more information.

The U.S. Government Department of Commerce, Bureau of Industry and Security (BIS), has classified this software as Export Commodity Control Number (ECCN) 5D002.C.1, which includes information security software using or performing cryptographic functions with asymmetric algorithms. The form and manner of this Apache Software Foundation distribution makes it eligible for export under the License Exception ENC Technology Software Unrestricted (TSU) exception (see the BIS Export Administration Regulations, Section 740.13) for both object code and source code.

The following provides more details on the included cryptographic software:

  • Apache Geode links to and uses OpenSSL ciphers.