Skip to content

Cover box_wait_limbo_acked with tests #7318

@grafin

Description

@grafin

Bug description

Currently all the tests pass fine with the following patch:

diff --git a/src/box/box.cc b/src/box/box.cc
index bfef966fd..1decb956a 100644
--- a/src/box/box.cc
+++ b/src/box/box.cc
@@ -1879,16 +1879,24 @@ box_wait_limbo_acked(double timeout)
        last_entry = txn_limbo_last_synchro_entry(&txn_limbo);
        /* Wait for the last entries WAL write. */
        if (last_entry->lsn < 0) {
+               assert(false);
                int64_t tid = last_entry->txn->id;

-               if (wal_sync(NULL) != 0)
+               if (wal_sync(NULL) != 0) {
+                       assert(false);
                        return -1;
+               }

-               if (box_check_promote_term_intact(promote_term) != 0)
+               if (box_check_promote_term_intact(promote_term) != 0) {
+                       assert(false);
                        return -1;
-               if (txn_limbo_is_empty(&txn_limbo))
+               }
+               if (txn_limbo_is_empty(&txn_limbo)) {
+                       assert(false);
                        return txn_limbo.confirmed_lsn;
+               }
                if (tid != txn_limbo_last_synchro_entry(&txn_limbo)->txn->id) {
+                       assert(false);
                        diag_set(ClientError, ER_QUORUM_WAIT, quorum,
                                 "new synchronous transactions appeared");
                        return -1;
@@ -1900,18 +1908,24 @@ box_wait_limbo_acked(double timeout)
        if (box_wait_quorum(txn_limbo.owner_id, wait_lsn, quorum, timeout) != 0)
                return -1;

-       if (box_check_promote_term_intact(promote_term) != 0)
+       if (box_check_promote_term_intact(promote_term) != 0) {
+               assert(false);
                return -1;
+       }

-       if (txn_limbo_is_empty(&txn_limbo))
+       if (txn_limbo_is_empty(&txn_limbo)) {
+               assert(false);
                return txn_limbo.confirmed_lsn;
+       }

        if (quorum < replication_synchro_quorum) {
+               assert(false);
                diag_set(ClientError, ER_QUORUM_WAIT, quorum,
                         "quorum was increased while waiting");
                return -1;
        }
        if (wait_lsn < txn_limbo_last_synchro_entry(&txn_limbo)->lsn) {
+               assert(false);
                diag_set(ClientError, ER_QUORUM_WAIT, quorum,
                         "new synchronous transactions appeared");
                return -1;

Actual behavior

All tests pass.

Expected behavior

Some tests fail.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions