GEODE-9591: Don't retry function when Function.isHA=false (#866)

* GEODE-9591: Don't retry function when Function.isHA=false

Fault:
Client clears result by calling ResultCollector::clearResult and
re-executes the function even thought Function.isHa() is set to false.

Fix:
Client will not clear result and retry the function, but it will fail with the
received exception from server.

Added integration test:
1.FunctionExecutionTest.testThatFunctionExecutionThrowsExceptionNonHAWithFilter
2.FunctionExecutionTest.testThatFunctionExecutionThrowsExceptionNonHA

The integration test reproduces the problem in a following way:

1. Populate region so that all buckets are created
2. Shutdown one of the three available servers
3. Peforme rebalance operation, so that buckets are recovered on running
servers
4. Execute the function. Function execution will fail with the
InternalFunctionInvocationTargetException exception, because client will
try to execute single hop function with old PR meatada information (PR
metadata received before the rebalance operation).

* ASSERT_THROW used instead of try-catch

* Check whether isHA==false before clearing results

It is possible that function exeuction fail on multiple servers, and in
that case only first exception will be thrown, and any subsequent
exeception will be ignored. Additionally result should not be cleared in
any case when isHa==false.

* Rebalance cmd was not executed

Test cases are changed to do rebalance operation
after new server is introduced in cluster.

* Client metadata wasn't complete when function is executed

Since client metadata was not complete the function was not exectued in
a single hop manner, and therfore exeption is not reproduced.

This commit is fixed in a way that now client is connected to only
one server. This way client metadata will be updated more frequently,
and client metadata will be complete when function is executed.
6 files changed
tree: 8eed4af640f1e67ad9941eace23fd8dca9b04fe9
  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.