With reduced span cache time the block service cache
is no longer needed. We also don't need to fetch
changed block services from registry as we'll get
it as part of span fetches.
Waiting on each CDC operation is too expensive.
The only race we have a problem with is during directory creation,
where an observer must not see the directory before it is fully created.
This is a targeted fix until we can implement a more general solution.
CDC coordinates cross shard transactions.
State machines in it guarantee ordering of events.
In order for order to be guaranteed in all locations,
we need to ensure that all locations have applied the state.
Remove -read-whole-file flag and decide read-ahead behavior based on
storage class: always read ahead for HDD, never for FLASH. Only issue
fadvise syscall when reading ahead to save unnecessary syscalls for FLASH
storage.
Fixes#47
Co-authored-by: mcrnic <miroslav.crnic@xtxmarkets.com>
RenameDirectory state machine was not handling target not found correctly.
This would have caused asserts (which result in crashes in production builds)
There was also a bug in the rollback logic which would have caused a lingering
lock on the source link. While breaking assumptions this was a benign bug as
any operation on that directory would try and succeed acquiring this lock again.
It would succeed as lock requests are idempotent.
* kmod: minor write path fixes
We didn't actually see these happen in production.
Fix 1:
From kernel code it looks like copy_page_from_iter can not return 0 in
normal cases but our code should still cover the case if this changes in
the future.
Fix 2:
-ENOMEM was other error where we could write things partially in which
case we would not return written and we would end up at wrong offset.
It's simpler to just return written if we managed to write anything
and surface the error on subsequent call in which we will fail early.
* kmod: add BUG_ON for unexpected span pages