-
-
Notifications
You must be signed in to change notification settings - Fork 138
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Avro 1.12.0 breaks jackson-dataformat-avro (also: requires JDK 11) #514
Comments
Yes, see #167 -- you cannot upgrade Jackson 2.17 and below to Avro library past 1.8.2. But upcoming 2.18.0 should allow upgrade. |
Thanks @cowtowncoder. It's interesting that we've been successfully using AVRO 1.11.2 so it must be some edge cases that we aren't currently hitting. |
@rdifrango Ah. I forgot that the issue wrt upgrade were mostly in unit tests, not on binary compatibility between module and codec library. But I hope 2.18.0-rc1 -- being released today! -- will work with 1.12.x and above. |
2.18.0-rc1 now released: @rdifrango not sure if it's easy to do, but it'd be great to see if upgrade would work with 2.18, for eventual 2.18.0 release |
I just tested it and I am seeing the same issue. I just looked at AvroMapper and noticed that here it still has |
@rdifrango rats. Ok. That may also explain why upgrade was to |
Quite possibly...and I'll grant that the move to |
It seems odd for Avro library to nominally follow SemVer but... seemingly not? But would be good to know why the method was removed & if it had been at least deprecated earlier. Plus whether there might be replacement to use, from older versions too. |
I'd agree @cowtowncoder especially since I'm having a conversation with on this PR with the commons-validator team and they are being very strict. I did look over on the avro side, but couldn't find any specific mention of why this was changed and it was unclear to me if it's now simply the default behavior of the parser or not. Should we ask over there as well? |
@rdifrango I guess damage is done, API compatibility broken b/w versions. So not sure how much value there would be. |
agreed the damage is done, the commons-validator was more an indicator that other apache projects seem to hold to strict guidelines around binary and API compatibility which clearly Avro has not. |
One other reason why we probably cannot upgrade: looks like Avro 1.12.0 is built with JDK 11, and Jackson 2.18 still has Java 8 as the baseline. |
That definitely makes this tricky, any thoughts on a path forward? My concern is that if some sort of CVE is discovered in the AVRO project there currently isn't a path forward. |
@rdifrango No idea short-term. Things are tricky as it's multi-module Maven project so would need to at least build all with JDK 11; but then try to target JDK 8 (if even possible) for non-Avro backends. But on very short term I think baseline code needs to remain 1.11.x. Ideally we would let users override with newer version tho. And I think it'd actually be possible to use matrix build for CI testing to try version override, if we get module itself run against newer library version -- but that's not solved yet; how to avoid/change |
One quick note: Jackson 3.0 (from |
Ok, so Avro lib backwards-compatibility is really... not. There isn't any. 1.11.3 -> 1.11.4 breaks tests, as per #539. Patches can be as breaking as minor version or so. |
I'll try to take this on but it won't be until mid-January. |
I think upgrading Patch 1.11.4 is something users can opt-in regardless of what Jackson 2.x module defaults to (that is, for versions that default to 1.11.3, 2.18.x and 2.19) |
ok, I started looking at this and it seems to break a few of the tests. The two groups in particular In the one test I'm just trying to understand these tests before moving forward. |
and related, in ListWithPrimitiveWrapperTest.testListWithDoubles I'm getting the following in those same 2 tests:
|
@rdifrango Latter def sounds like |
I'm seeing on the reading side that it's hitting the Double section of
so I'm now looking at ObjectWriter to see how the bytes look and compare it to the other ones that do pass when using doubles. |
To your point, with
The one that fails with different values is:
The ones not working at all are:
|
Sounds like some level of casting would be needed, somewhere. But not quite sure how/why breakage; I guess Avro Codec started using more accurate Java types, maybe, for its binding (or more generic?). I know above is not super helpful, just thinking out aloud I guess. |
Well, for the double case, I at least tracked it down to here and it's close to what you thought, they're converting the Double to a floatValue and when it's called it returns either |
@rdifrango Thank you for tracking that down, yes, symptoms fit the problem. Could you file a bug (and maybe even PR) against Avro-lib, that definitely looks like a straight-forward bug, possibly copy-paste error? This would solve just one problem case, I suppose, but ... one step at a time. |
Thank you @rdifrango ! |
No worries and I'm working on the PR to fix that. I also think the following change is what caused this and is the one causing the failures with apache/avro#2389, specifically this comment. |
@cowtowncoder, the first PR is in: Now to prove my theory on the PR that may have caused the other failures. |
We were attempting to upgrade our project to Avro 1.12.0 with
jackson-dataformat-avro
version2.17.2
The failure I get is as follows:
To demonstrate this, I created the following example program that uses issue19.avsc as the schema to load.
The text was updated successfully, but these errors were encountered: