Platform specific fixes#609
Open
Giperboloid wants to merge 3 commits intoApsaraDB:POLARDB_15_STABLEfrom
Open
Conversation
a701d25 to
dd5a0eb
Compare
polar_monitor extension with no functional changes for Linux. In particular: - Removed inclusion of <linux/limits.h> from procstat.h and related sources. Verified that no constants (e.g., PATH_MAX, NAME_MAX) from <linux/limits.h> are used in procstat.h, procstat.c, or polar_monitor_io.c. - Wrapped usage of <linux/sockios.h>, TCP_INFO, SOL_TCP, SIOCOUTQ, and SIOCINQ with #ifdef __linux__ in polar_network_stats.c Provided safe fallbacks: set values to 0 or skip updates.
polar_vfs. In particular: - Gate .vfs_posix_fallocate behind HAVE_POSIX_FALLOCATE across VFS managers. Wrap .vfs_posix_fallocate assignments with HAVE_POSIX_FALLOCATE and set to NULL when the platform does not provide posix_fallocate.
In particular: - an early return is added when open() fails to avoid calling fadvise()/close() on an invalid fd. - platform specific posix_fadvise() call was replaced with appropriate polar_posix_fadvise() call. The invocation is guarded with directives USE_POSIX_FADVISE and POSIX_FADV_DONTNEED. Falls back to no-op when the call is unavailable. This aligns the function's behavior with existing PolarDB practice in fd.c, xlog.c, etc. - the polar_fd.h header file was included to make the polar_posix_fadvise() function available.
dd5a0eb to
c35f1c2
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
Several minor changes are proposed that could improve portability in the future.