OpenSearch/server
Jason Tedor cb3295b212
Close translog writer if exception on write channel (#29401)
Today we close the translog write tragically if we experience any I/O
exception on a write. These tragic closes lead to use closing the
translog and failing the engine. Yet, there is one case that is missed
which is when we touch the write channel during a read (checking if
reading from the writer would put us past what has been flushed). This
commit addresses this by closing the writer tragically if we encounter
an I/O exception on the write channel while reading. This becomes
interesting when we consider that this method is invoked from the engine
through the translog as part of getting a document from the
translog. This means we have to consider closing the translog here as
well which will cascade up into us finally failing the engine.

Note that there is no semantic change to, for example, primary/replica
resync and recovery. These actions will take a snapshot of the translog
which syncs the translog to disk. If an I/O exception occurs during the
sync we already close the writer tragically and once we have synced we
do not ever read past the position that was synced while taking the
snapshot.
2018-04-06 10:33:21 -04:00
..
cli CLI: Close subcommands in MultiCommand (#28954) 2018-03-16 09:59:23 +11:00
licenses Upgrade to lucene 7.3.0 (#29387) 2018-04-05 10:34:44 +01:00
src Close translog writer if exception on write channel (#29401) 2018-04-06 10:33:21 -04:00
build.gradle Build: Fix Java9 MR build (#29312) 2018-04-03 10:22:12 -07:00