]> git.proxmox.com Git - ceph.git/blame - ceph/src/seastar/doc/compatibility.md
update source to Ceph Pacific 16.2.2
[ceph.git] / ceph / src / seastar / doc / compatibility.md
CommitLineData
f67539c2
TL
1Compatibility
2=============
3
4As a library, Seastar aims to maintain backwards compatibility
5in terms of the source (application code should continue to
6build with newer versions of Seastar) and any binary protocols
7that Seastar exposes (e.g. rpc).
8
9Link compatibility is not maintained - you cannot link an
10application built with one version of Seastar with another
11version of Seastar.
12
13Language dialects
14=================
15
16Seastar will support the last two standards approved by the
17ISO C++ committee. For example, after C++20 is released,
18Seastar supports C++17 and C++20. Similarly, when C++23 is released,
19Seastar will support C++20 and C++23.
20
21Some features may only be enabled for newer dialects.
22
23
24Platforms
25=========
26
27Seastar supports Linux. There is no known minimum kernel version,
28but very old kernels might not work. Performance can be significantly
29better for newer kernels.
30
31Filesystem implementation quality can have significant effect on
32file I/O performance. XFS is known to be working, ext4 may work well
33too. Test your filesystem and kernel versions to be sure.
34
35Patches for new platforms (e.g, Windows) are welcome.
36
37
38Compilers
39=========
40
41Seastar supports gcc and clang. Ports to other compilers are
42welcome.
43
44The last two major releases of a compiler are supported (e.g.
45gcc 9 and gcc 10). Patches to support older versions are welcome,
46as long as they don't require onerous compromises.
47
48Deprecation
49===========
50
51Occasionally, we discover that we took the wrong approach with
52an API. In these cases we will offer a new API and tag the old
53API with the [[deprecated]] attribute. The deprecated API will
54be removed after a transition period (which can vary depending on
55how central the deprecated API is).
56
57Breaking changes
58================
59
60Rarely, we have to make breaking changes. We try to limit those,
61but sometimes there is no choice.
62
63To support a transition period for breaking changes, Seastar
64offers the Seastar_API_LEVEL cmake variable (and corresponding
65--api-level configure.py option). An API level selects different
66versions of the API. For example.
67
68 - Seastar_API_LEVEL=1 selects an old version of the
69 server_socket::accept() API that returns a variadic
70 future (which is deprecated)
71 - Seastar_API_LEVEL=2 selects a new version of the
72 server_socket::accept() API that returns a non-variadic
73 future
74 - Seastar_API_LEVEL=6 makes futures non-variadic
75
76Applications can use an old API_LEVEL during a transition
77period, fix their code, and move to the new API_LEVEL.
78
79Old API levels only live for a transition period, so if
80you are using an API level below the latest, you should
81upgrade quickly.
82
83Note the application should not refer to the `api_vN`
84sub-namespaces that Seastar defines as part of the API_LEVEL
85mechanism; these are internal.
86
87Internal namespace
88==================
89
90Identifiers in the `seastar::internal` namespace are not subject
91to source level compatibility and are subject to change or removal
92without notice. In addition the `api_vN` sub-namespaces are also
93internal.
94
95Accidentally exposed internal identifiers
96=========================================
97
98Some identifiers predate the internal namespace, and are only
99exposed accidentally. These can also be removed or changed. Exposed
100identifiers are documented using doxygen, but not all exposed
101APIs are documented. In case of doubt, ask on the mailing list.
102
103
104API Level History
105=================
106
107|Level|Introduced |Mandatory|Description |
108|:---:|:---------:|:-------:| -------------------------------------------- |
109| 2 | 2019-07 | 2020-04 | Non-variadic futures in socket::accept() |
110| 3 | 2020-05 | | make_file_data_sink() closes file and returns a future<> |
111| 4 | 2020-06 | | Non-variadic futures in when_all_succeed() |
112
113
114Note: The "mandatory" column indicates when backwards compatibility
115support for the API preceding the new level was removed.
116
117Implementation notes for API levels
118===================================
119
120API levels are implemented by defining internal sub-namespaces
121for each API level: `seastar::api_v1`, `seatar::api_v2` etc. `#ifdef`s
122are used to inline the user-selected API level namespace into the
123main `seastar` namespace, making it visible.
124
125Usually, the old API is implemented in terms of the new API to
126avoid code duplication.
127
128Here is an example about the transition from API_LEVEL 1 to 2. The
129transition from 2 to 3 and similar is analogous.
130
131Unconditionally:
132 - the new API is defined in sub-namespace `api_v2`
133
134If API_LEVEL is 2:
135 - `api_v2` namespace is inlined into the `seastar` namespace
136
137If API_LEVEL is 1:
138 - the old API is defined in sub-namespace `api_v1`
139 - `api_v1` is implemented in terms of `api_v2` to prevent code duplication
140 - `api_v1` namespace is inlined into the `seastar` namespace
141
142After a transition period:
143 - everthing in `api_v1` is dropped
144 - `api_v2` is removed, and its contents is placed in the parent namespace