diff --git a/CMakeLists.txt b/CMakeLists.txt index 1826bfdd5d..9089a21392 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -187,7 +187,9 @@ if(NOT WIN32) else() add_subdirectory(fdbservice) endif() -add_subdirectory(bindings) +if(WITH_PYTHON) + add_subdirectory(bindings) +endif() add_subdirectory(fdbbackup) add_subdirectory(tests) if(WITH_DOCUMENTATION) @@ -205,13 +207,13 @@ endif() # process compile commands for IDE ################################################################################ -if (CMAKE_EXPORT_COMPILE_COMMANDS) +if (CMAKE_EXPORT_COMPILE_COMMANDS AND WITH_PYTHON) add_custom_command( - OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json - COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build/gen_compile_db.py - ARGS -b ${CMAKE_CURRENT_BINARY_DIR} -s ${CMAKE_CURRENT_SOURCE_DIR} -o ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json - DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/build/gen_compile_db.py ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json - COMMENT "Build compile commands for IDE" + OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json + COMMAND $ ${CMAKE_CURRENT_SOURCE_DIR}/build/gen_compile_db.py + ARGS -b ${CMAKE_CURRENT_BINARY_DIR} -s ${CMAKE_CURRENT_SOURCE_DIR} -o ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/build/gen_compile_db.py ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json + COMMENT "Build compile commands for IDE" ) add_custom_target(processed_compile_commands ALL DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/compile_commands.json ${CMAKE_CURRENT_BINARY_DIR}/compile_commands.json) endif() diff --git a/cmake/ConfigureCompiler.cmake b/cmake/ConfigureCompiler.cmake index 56a532a24b..d2941bc4b4 100644 --- a/cmake/ConfigureCompiler.cmake +++ b/cmake/ConfigureCompiler.cmake @@ -85,7 +85,11 @@ if(WIN32) # see: https://docs.microsoft.com/en-us/windows/desktop/WinProg/using-the-windows-headers # this sets the windows target version to Windows Server 2003 set(WINDOWS_TARGET 0x0502) - add_compile_options(/W3 /EHsc /bigobj $<$:/Zi> /MP /FC) + if(CMAKE_CXX_FLAGS MATCHES "/W[0-4]") + # TODO: This doesn't seem to be good style, but I couldn't find a better way so far + string(REGEX REPLACE "/W[0-4]" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") + endif() + add_compile_options(/W0 /EHsc /bigobj $<$:/Zi> /MP /FC /Gm-) add_compile_definitions(_WIN32_WINNT=${WINDOWS_TARGET} WINVER=${WINDOWS_TARGET} NTDDI_VERSION=0x05020000 BOOST_ALL_NO_LIB) set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT") set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd") diff --git a/cmake/FDBComponents.cmake b/cmake/FDBComponents.cmake index 69e93cec06..3ce0a873dd 100644 --- a/cmake/FDBComponents.cmake +++ b/cmake/FDBComponents.cmake @@ -33,7 +33,7 @@ endif() ################################################################################ set(WITH_JAVA OFF) -find_package(JNI 1.8 REQUIRED) +find_package(JNI 1.8) find_package(Java 1.8 COMPONENTS Development) if(JNI_FOUND AND Java_FOUND AND Java_Development_FOUND) set(WITH_JAVA ON) @@ -51,7 +51,7 @@ find_package(Python COMPONENTS Interpreter) if(Python_Interpreter_FOUND) set(WITH_PYTHON ON) else() - message(FATAL_ERROR "Could not found a suitable python interpreter") + #message(FATAL_ERROR "Could not found a suitable python interpreter") set(WITH_PYTHON OFF) endif() @@ -102,6 +102,8 @@ function(print_components) message(STATUS "Build Ruby bindings: ${WITH_RUBY}") message(STATUS "Build Python sdist (make package): ${WITH_PYTHON}") message(STATUS "Build Documentation (make html): ${WITH_DOCUMENTATION}") + message(STATUS "Build Bindings (depends on Python): ${WITH_PYTHON}") + message(STATUS "Configure CTest (depends on Python): ${WITH_PYTHON}") message(STATUS "=========================================") endfunction() diff --git a/cmake/FlowCommands.cmake b/cmake/FlowCommands.cmake index a34efb4d73..1a3914f3de 100644 --- a/cmake/FlowCommands.cmake +++ b/cmake/FlowCommands.cmake @@ -185,12 +185,12 @@ function(add_flow_target) if(WIN32) add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${generated}" COMMAND $ "${CMAKE_CURRENT_SOURCE_DIR}/${src}" "${CMAKE_CURRENT_BINARY_DIR}/${generated}" ${actor_compiler_flags} - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${src}" actorcompiler + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${src}" COMMENT "Compile actor: ${src}") else() add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/${generated}" COMMAND ${MONO_EXECUTABLE} ${actor_exe} "${CMAKE_CURRENT_SOURCE_DIR}/${src}" "${CMAKE_CURRENT_BINARY_DIR}/${generated}" ${actor_compiler_flags} > /dev/null - DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${src}" actorcompiler + DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${src}" COMMENT "Compile actor: ${src}") endif() else() @@ -220,15 +220,18 @@ function(add_flow_target) get_filename_component(dname ${CMAKE_CURRENT_SOURCE_DIR} NAME) string(REGEX REPLACE "\\..*" "" fname ${src}) string(REPLACE / _ fname ${fname}) - set_source_files_properties(${src} PROPERTIES COMPILE_DEFINITIONS FNAME=${dname}_${fname}) + #set_source_files_properties(${src} PROPERTIES COMPILE_DEFINITIONS FNAME=${dname}_${fname}) endforeach() set_property(TARGET ${AFT_NAME} PROPERTY SOURCE_FILES ${AFT_SRCS}) set_property(TARGET ${AFT_NAME} PROPERTY COVERAGE_FILTERS ${AFT_SRCS}) add_custom_target(${AFT_NAME}_actors DEPENDS ${generated_files}) + add_dependencies(${AFT_NAME}_actors actorcompiler) add_dependencies(${AFT_NAME} ${AFT_NAME}_actors) - assert_no_version_h(${AFT_NAME}_actors) + if(NOT WIN32) + assert_no_version_h(${AFT_NAME}_actors) + endif() generate_coverage_xml(${AFT_NAME}) if(strip_target) strip_debug_symbols(${AFT_NAME}) diff --git a/documentation/sphinx/source/data-modeling.rst b/documentation/sphinx/source/data-modeling.rst index 24f3aad203..ad8363ce83 100644 --- a/documentation/sphinx/source/data-modeling.rst +++ b/documentation/sphinx/source/data-modeling.rst @@ -269,6 +269,18 @@ Using the table name as the subspace, we could implement the common row-oriented cols[c] = v return cols + +Versionstamps +------------- + +A common data model is to index your data with a sequencing prefix to allow log scans or tails of recent data. This index requires a unique, monotonically increasing value, like an AUTO_INCREMENT PRIMARY KEY in SQL. This could be implemented at the client level by reading the value for conflict checks before every increment. A better solution is the versionstamp, which can be generated at commit-time with no read conflict ranges, providing a unique sequence ID in a single conflict-free write. + +Versioning commits provides FoundationDB with MVCC guarantees and transactional integrity. Versionstamps write the transaction's commit version as a value to an arbitrary key as part of the same transaction, allowing the client to leverage the version's unique and serial properties. Because the versionstamp is generated at commit-time, the versionstamped key cannot be read in the same transaction that it is written, and the versionstamp's value will be unknown until the transaction is committed. After the transaction is committed, the versionstamp can be obtained. + +The versionstamp guarantees uniqueness and monotonically increasing values for the entire lifetime of a single FDB cluster. This is even true if the cluster is restored from a backup, as a restored cluster will begin at a higher version than when the backup was taken. Special care must be taken when moving data between two FoundationDB clusters containing versionstamps, as the differing cluster versions might break the monotonicity. + +There are two concepts of versionstamp depending on your context. At the fdb_c client level, or any binding outside of the Tuple layer, the 'versionstamp' is 10 bytes: the transaction's commit version (8 bytes) and transaction batch order (2 bytes). The user can manually add 2 additional bytes to provide application level ordering. The tuple layer provides a useful api for getting and setting both the 10 byte system version and the 2 byte user version. In the context of the Tuple layer, the 'versionstamp' is all 12 bytes. For examples on how to use the versionstamp in the python binding, see the :doc:`api-python` documentation. + .. _data-modeling-entity-relationship: Entity-relationship models diff --git a/documentation/sphinx/source/release-notes.rst b/documentation/sphinx/source/release-notes.rst index be9517818d..772e2d1086 100644 --- a/documentation/sphinx/source/release-notes.rst +++ b/documentation/sphinx/source/release-notes.rst @@ -2,6 +2,15 @@ Release Notes ############# +6.2.16 +====== + +Fixes +----- + +* Storage servers could fail to advance their version correctly in response to empty commits. `(PR #2617) `_. +* The ``TR_FLAG_DISABLE_MACHINE_TEAM_REMOVER``, ``TR_FLAG_REMOVE_MT_WITH_MOST_TEAMS``, ``TR_FLAG_DISABLE_SERVER_TEAM_REMOVER``, and ``BUGGIFY_ALL_COORDINATION`` knobs could not be set at runtime. `(PR #2661) `_. + 6.2.15 ====== diff --git a/fdbclient/vexillographer/fdb.options b/fdbclient/vexillographer/fdb.options index b8d4f420fb..37eb2e339d 100644 --- a/fdbclient/vexillographer/fdb.options +++ b/fdbclient/vexillographer/fdb.options @@ -158,7 +158,7 @@ description is not currently required but encouraged. defaultFor="500"/>