Ensured correct object status if the object is not found on a node.
Fixed regression introduced in #1450.
Besides an object not being found on any shard, it also important to
remove it anyway in order to populate the metabase indexes because
they are responsible for the correct object status, i.e., the status
will be `object not found` without the indexes, the status will be
`object is already removed` with the indexes.
Change-Id: I6237fbc0f8bb0c4f2a51ada3a68f52950050e660
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
- Use the same storage engine in multiple parallel tests
- Move `Lock`, `Inhume`, `Head` calls to separate functions
Change-Id: I00849c1f068f0ab8d92061719d67d6fe786200db
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
Removed an invalid test case which used exclusive options, added
object status check after removal.
Change-Id: I4551c0e4532fb669ee6c72871dc4bd34707d8469
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
Return `object is locked` error if object doesn't exists but is
locked, since the locked index may be populated even when the object
itself doesn't exist.
Change-Id: If1a145c6efead9873acd33bb4fd22cf6175cbabd
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
Currently, it's allowed to inhume or lock an expired object.
Consider the following scenario:
1) An user inhumes or locks an object
2) The object expires
3) GC hasn't yet deleted the object
4) The node loses the associated tombstone or lock
5) Another node replicates tombstone or lock to the first node
In this case, the second node succeeds, which is the desired behavior.
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
- Remove `testNewShard` and `setInitializedShards` because they
violated the default engine workflow. The correct workflow is:
first use `New()`, followed by `Open()`, and then `Init()`. As a
result, adding new logic to `(*StorageEngine).Init` caused several
tests to fail with a panic when attempting to access uninitialized
resources. Now, all engines created with the test utils must be
initialized manually. The new helper method `prepare` can be used
for that purpose.
- Additionally, `setInitializedShards` hardcoded the shard worker
pool size, which prevented it from being configured in tests and
benchmarks. This has been fixed as well.
- Ensure engine initialization is done wherever it was missing.
- Refactor `setShardsNumOpts`, `setShardsNumAdditionalOpts`, and
`setShardsNum`. Make them all depend on `setShardsNumOpts`.
Signed-off-by: Aleksey Savchuk <a.savchuk@yadro.com>
Core changes:
* avoid package-colliding variable naming
* avoid using pointers to IDs where unnecessary
* avoid using `idSDK` import alias pattern
* use `EncodeToString` for protocol string calculation and `String` for
printing
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Remove `Object` and `RawObject` types from `pkg/core/object` package.
Use `Object` type from NeoFS SDK Go library everywhere. Avoid using the
deprecated elements.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Make `BlockExecution` / `ResumeExecution` to not release per-shard worker
pools. Make `StorageEngine.Close` to block these methods and any
data-related operations. It is still releases the pools.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
Write unit tests of `StorageEngine.Inhume` which assert that inhumed objects
don't appear in `Select` result.
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>