Commit Graph

63 Commits

Author SHA1 Message Date
Oswald Buddenhagen
406931bc45 autotest: use symbolic message subjects
... instead of numbers. otherwise there is too much confusion with UIDs.
2020-08-04 14:49:57 +02:00
Oswald Buddenhagen
6734b9ce7d autotest: re-order mailbox contents according to UIDs
... instead of subjects, because that's way more natural and thus less
confusing.
2020-08-04 14:49:57 +02:00
Oswald Buddenhagen
f3629c69e1 autotest: re-organize mailbox storage by UID
an effect of 7ce658d is that we can index messages by UID rather than
content (or more specifically, subject). apart from being cleaner, it
allows duplicated subjects.
2020-08-04 14:49:57 +02:00
Oswald Buddenhagen
b59ee239a4 autotest: assume that each message has a UID
followup to 7ce658d14.
2020-08-04 14:49:57 +02:00
Oswald Buddenhagen
50eab08509 autotest: show the right state file after idempotence test failure
amends efd72b85.
2020-08-04 14:49:57 +02:00
Oswald Buddenhagen
d59392e901 autotest: fix prototype of ckbox() 2020-08-04 14:49:57 +02:00
Oswald Buddenhagen
ef2caa074e autotest: create the temp dir in $TEMP
on modern systems, this makes it likely to end up on tmpfs, which is a
lot faster and ssd-friendlier.

the symlink is not deleted at the end, to minimize fs churn. that means
it will be dangling after a reboot, which gets fixed in the next run.
2020-08-04 14:49:57 +02:00
Oswald Buddenhagen
bd5fb6fff3 move away from magic UIDs in the sync state
the only legitimate "deviant" UID is zero, meaning "no message". this
can be futher qualified by additional flags in the sync record, rather
than using magic values for the UID. in fact, the zero UID (so far
meaning only "expunged") was already optionally qualifed with "expired".

as a side effect, driver->store_msg() now returns 0 instead of -2 for
unknown UIDs. this was a hack to avoid translating the value later
on, but it made the api horrible, and now it's superflous in the first
place.
2017-04-22 11:26:12 +02:00
Oswald Buddenhagen
efd72b85cc autotest: implement much more thorough resumption verification
the test will now make a test run for every journaled step, both right
before and right after the logging.
2017-04-22 11:26:12 +02:00
Oswald Buddenhagen
7ce658d14c autotest: pre-assign all UIDs of the test messages
this ensures stable results when the boxes are used with different
OPEN_FLAGS (which will happen in a subsequent commit), at the negligible
cost of removing the implicit test of the maildir driver's ability to
enumerate new messages.
2017-04-22 11:26:12 +02:00
Oswald Buddenhagen
36666f7e52 rewrite tracking of highest expired UID
so far, we tracked the slave side, and calculated the master side on the
fly. that complicated things unnecessarily.
2017-04-02 17:12:50 +02:00
Oswald Buddenhagen
0aa4c628df add comments 2017-04-02 17:12:50 +02:00
Oswald Buddenhagen
d754608f55 autotest: improve valgrind integration
introduce recognition of $USE_VALGRIND to run all mbsync invocations
through valgrind.

this also removes the seemingly purposeless --log-fd=3 indirection.
2017-04-01 20:32:36 +02:00
Oswald Buddenhagen
f29bed526b autotest: write logs to files
they can get long, and having actual files also helps with diffing.
2017-04-01 20:32:36 +02:00
Oswald Buddenhagen
991e809c38 autotest: factor out readfile() function 2017-04-01 20:32:36 +02:00
Oswald Buddenhagen
2da7951fe0 autotest: de-duplicate error reporting paths 2017-04-01 20:32:36 +02:00
Oswald Buddenhagen
373abcef02 autotest: print consistent information for journal replay failures 2017-04-01 20:32:36 +02:00
Oswald Buddenhagen
ca43c57e85 autotest: don't print expected result if the mbsync run itself fails
there isn't an actual result to compare with anyway.
2017-04-01 20:32:36 +02:00
Oswald Buddenhagen
b4d1a05365 autotest: de-duplicate: use print*() in show*()
this actually adds some (minimal) transformation overhead, but it makes
the relationship clearer.
2017-04-01 20:32:36 +02:00
Oswald Buddenhagen
8aed94420f autotest: determine path of mbsync prior to chdir()
that allows tmp/ to be a symlink to a ramdisk.
2017-04-01 20:32:36 +02:00
Oswald Buddenhagen
62808c9003 autotest: use warnings 2017-04-01 20:25:58 +02:00
Oswald Buddenhagen
b45e711da5 autotest: remove stray close() call from printstate() 2017-04-01 20:25:53 +02:00
Oswald Buddenhagen
f62b3c7be9 fix mislabeling of test 2017-02-15 17:44:35 +01:00
Oswald Buddenhagen
71524cb6b0 reduce FSync option to a boolean
there is no use for Thorough mode any more, so simplify the
configuration.
2013-12-08 11:12:09 +01:00
Oswald Buddenhagen
8d5bd62537 add ExpireUnread option 2013-12-08 11:12:09 +01:00
Oswald Buddenhagen
fe3d19b7eb verify idempotence of all sync operations 2013-12-01 13:36:28 +01:00
Oswald Buddenhagen
b1842617f7 make MaxMessages work for new mails as well
this helps enormously on the first sync of a 100k message box with a
limit of 1k messages. it also happens to make the syncing idempotent.

in a few conditionals we now explicitly test for max_messages being
enabled, not smaxxuid != 0, as after the initial fetch with no important
messages smaxxuid is zero, but we still have to skip over 99k messages
in the above case.
2013-12-01 13:36:28 +01:00
Oswald Buddenhagen
12676f28da remove cleanup of expired entries during setup of master load
the removed code would only ever trigger if a) we were after a journal
replay or b) something external expunged the expired messages - both are
corner cases not worth the extra code.
however, this means that the syncing code further down now needs to take
care of these zombies.
in the end, the normal cleanup will take care of all expired entries,
new and old.
2013-12-01 13:36:27 +01:00
Oswald Buddenhagen
48754ecc74 make sync state header format less obscure
the header is not space-critical, so use proper name-value pairs.
this has the additional advantage that subsequent format changes can be
done much easier.
2013-12-01 13:36:27 +01:00
Oswald Buddenhagen
83bb1cf716 make state loading in showstate() similar to ckstate() 2013-12-01 13:36:27 +01:00
Oswald Buddenhagen
f044adbfa4 take configs out of target state defs
cleaner and less duplication
2013-12-01 13:36:27 +01:00
Oswald Buddenhagen
5297425918 more precise failure reporting 2013-12-01 13:36:27 +01:00
Oswald Buddenhagen
3d81ccbf21 make it possible to run only selected tests 2013-12-01 13:36:27 +01:00
Oswald Buddenhagen
32def5dc0a add/fix comments and improve debug messages 2013-12-01 13:36:26 +01:00
Oswald Buddenhagen
9a0e65f899 create unseen messages in /new/
seen messages still go to /cur/.
this is consistent with the actual maildir driver.
2013-12-01 13:35:01 +01:00
Oswald Buddenhagen
0a684bd933 be a bit more verbose 2013-12-01 13:35:01 +01:00
Oswald Buddenhagen
394aca03a2 properly handle unexpected exit while replaying journal 2013-12-01 13:35:01 +01:00
Oswald Buddenhagen
07377cb753 ensure that the journal replay pass really does nothing 2013-12-01 13:35:01 +01:00
Oswald Buddenhagen
100f9487f4 sort messages by serial number instead of UID in box dumper
the input data is sorted that way, so it's easier to compare.
2013-12-01 13:35:01 +01:00
Oswald Buddenhagen
2568459a7b fix error message in sync state dumper 2013-12-01 13:35:00 +01:00
Oswald Buddenhagen
9261897629 don't record newuid in the sync state
this value is only ever used to find just pushed messages by TUID, so we
can simply use the UIDNEXT value from before we started pushing - and of
course, we need to record that in the journal. it makes no sense to log
the new value after completing a search, as there won't be a next search
before we push the next messages.
2013-03-30 16:46:18 +01:00
Oswald Buddenhagen
35851f133b add option to control amount of fsync()ing 2012-09-15 15:28:15 +02:00
Oswald Buddenhagen
d4c786823d replace FSF address with something more ... contemporary 2012-09-01 21:15:53 +02:00
Oswald Buddenhagen
233f563569 deal with concurrent maildir modifications during listing
files may be renamed (due to new -> cur transition or flag changes),
which may lead to two effects if ignored:
- we see both the old and the new name, so we report a spurious
  duplicate UID
- we see neither name, so we report a spurious deletion

as countermeasure, record and compare directory modification times. upon
mismatch, we just start over - as usual.
2012-09-01 21:15:07 +02:00
Oswald Buddenhagen
9c86ec3442 employ alternative scheme to finding messages by TUID
instead of SEARCHing every single message (which is slow and happens to
be unreliabe with M$ Exchange 2010), just FETCH the new messages from
the mailbox - the ones we just appended will be amongst them.
2012-09-01 21:15:07 +02:00
Oswald Buddenhagen
9056504483 handle abnormal program exit during regtest 2006-12-09 10:38:11 +00:00
Oswald Buddenhagen
d7b8621f05 add copyright + license 2006-02-11 19:48:44 +00:00
Oswald Buddenhagen
5e01034aee much improved journal replay testing.
some clenup.
2006-02-02 10:25:07 +00:00
Oswald Buddenhagen
d1c4f8a069 orphan/kill all affected entries after expunge 2006-02-02 10:04:05 +00:00
Oswald Buddenhagen
635b2d7b76 test for journalling and journal replay. 2006-01-29 15:48:24 +00:00