Files
gerrit/java
Edwin Kempin cb2ba3e7f9 CommentJsonMigrator: Improve error handling if comment note is too large
Schema 169 migrates comments in NoteDb to JSON. To check whether
comments need to be migrated the note blob with the comments needs to be
loaded. Loading the note blob failed if the blob was larger than 25 MB
and the schema migration failed with LargeObjectException. The 25 MB
limit was hard-coded. This change removes this hard-coded limit.
Loading the blob could still fail with LargeObjectException if the
object is too large to fit into a byte array. To prevent this we check
whether the object is too large before attempting to load it. If it's
too large we fail with an IOException. This is better than failing with
a LargeObjectException since it results in a proper log that says for
which change the problem occurred. After logging the IOException it is
ignored and the migration is attempted despite of it. It's not unlikely
that the migration still fails for note blobs that are larger than 25 MB
because the 25 MB limit for note blobs is also checked in other places
(e.g. in RevisionNote#parse()), but at least this change improves the
error reporting and should reveal if there are other places during the
migration that have a hard-coded limit.

Change-Id: Idaef9a65b7fcbd9e593ffbd7c097cbffd105a916
Signed-off-by: Edwin Kempin <ekempin@google.com>
2018-12-27 14:29:32 +01:00
..
2018-08-14 08:07:59 +02:00