rocksdb/memory
mrambacher fe9d495112 Return different Status based on ObjectRegistry::NewObject calls (#9333)
Summary:
This fix addresses https://github.com/facebook/rocksdb/issues/9299.

If attempting to create a new object via the ObjectRegistry and a factory is not found, the ObjectRegistry will return a "NotSupported" status.  This is the same behavior as previously.

If the factory is found but could not successfully create the object, an "InvalidArgument" status is returned.  If the factory returned a reason why (in the errmsg), this message will be in the returned status.

In practice, there are two options in the ConfigOptions that control how these errors are propagated:
- If "ignore_unknown_options=true", then both InvalidArgument and NotSupported status codes will be swallowed internally.  Both cases will return success
- If "ignore_unsupported_options=true", then having no factory will return success but a failing factory will return an error
- If both options are false, both cases (no and failing factory) will return errors.

In practice this likely only changes Customizable that may be partially available.  For example, the JEMallocMemoryAllocator is a built-in allocator that is registered with the system but may not be compiled in.  In this case, the status code for this allocator changed from NotSupported("JEMalloc not available") to InvalidArgumen("JEMalloc not available").  Other Customizable builtins/plugins would have the same semantics.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/9333

Reviewed By: pdillinger

Differential Revision: D33517681

Pulled By: mrambacher

fbshipit-source-id: 8033052d4a4a7b88c2d9f90147b1b4467e51f6fd
2022-02-11 05:11:24 -08:00
..
allocator.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
arena_test.cc Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
arena.cc Use thread-safe strerror_r() to get error message (#8087) 2021-03-24 23:07:27 -07:00
arena.h Replace most typedef with using= (#8751) 2021-09-07 11:31:59 -07:00
concurrent_arena.cc Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
concurrent_arena.h C++20 compatibility (#6697) 2020-04-20 13:24:25 -07:00
jemalloc_nodump_allocator.cc Make MemoryAllocator into a Customizable class (#8980) 2021-12-17 04:20:47 -08:00
jemalloc_nodump_allocator.h Make MemoryAllocator into a Customizable class (#8980) 2021-12-17 04:20:47 -08:00
memkind_kmem_allocator.cc Make MemoryAllocator into a Customizable class (#8980) 2021-12-17 04:20:47 -08:00
memkind_kmem_allocator.h Fix compilation error when building static_lib (#9377) 2022-01-12 09:04:01 -08:00
memory_allocator_test.cc Return different Status based on ObjectRegistry::NewObject calls (#9333) 2022-02-11 05:11:24 -08:00
memory_allocator.cc Restore Regex support for ObjectLibrary::Register, rename new APIs to allow old one to be deprecated in the future (#9362) 2022-01-11 06:33:48 -08:00
memory_allocator.h Replace namespace name "rocksdb" with ROCKSDB_NAMESPACE (#6433) 2020-02-20 12:09:57 -08:00
memory_usage.h Fix and detect headers with missing dependencies (#8893) 2021-09-10 10:00:26 -07:00