]> Sergey Matveev's repositories - public-inbox.git/log
public-inbox.git
6 years agov2writable: remove unnecessary idx_init call
Eric Wong (Contractor, The Linux Foundation) [Mon, 19 Mar 2018 08:14:36 +0000 (08:14 +0000)]
v2writable: remove unnecessary idx_init call

We no longer need it with ->barrier working

6 years agouse string ref for Email::Simple->new
Eric Wong (Contractor, The Linux Foundation) [Mon, 19 Mar 2018 08:14:35 +0000 (08:14 +0000)]
use string ref for Email::Simple->new

Email::Simple is slightly faster this way, and Email::MIME
and PublicInbox::MIME both wrap that.

6 years agov2writable: support "barrier" operation to avoid reforking
Eric Wong (Contractor, The Linux Foundation) [Mon, 19 Mar 2018 08:14:34 +0000 (08:14 +0000)]
v2writable: support "barrier" operation to avoid reforking

Stopping and starting a bunch of processes to look up duplicates
or removals is inefficient.  Take advantage of checkpointing
in "git fast-import" and transactions in Xapian and SQLite.

6 years agocontent_id: use Sender header if From is not available
Eric Wong (Contractor, The Linux Foundation) [Mon, 19 Mar 2018 08:14:33 +0000 (08:14 +0000)]
content_id: use Sender header if From is not available

We will be using Sender: in more places if the From: header
is not available, this is one of them.

Followup-to: ("import: fall back to Sender for extracting name and email")
6 years agoextmsg: rework partial MID matching to favor current inbox
Eric Wong (Contractor, The Linux Foundation) [Mon, 19 Mar 2018 07:51:09 +0000 (07:51 +0000)]
extmsg: rework partial MID matching to favor current inbox

The current inbox is more important for partial Message-ID
matching, so we try harder on that to fix common errors before
moving onto other inboxes.  Then, prevent expensive scanning of
other inboxes by requiring a Message-ID length of at least 16
bytes.

Finally, we limit the overall partial responses to 200 when
scanning other inboxes to avoid excessive memory usage.

6 years agov2writable: detect and use previous partition count
Eric Wong (Contractor, The Linux Foundation) [Tue, 6 Mar 2018 07:28:56 +0000 (07:28 +0000)]
v2writable: detect and use previous partition count

We need to detect the number of partitions the repository was
created with to ensure Xapian DBs can work across different
machines (or even CPU affinity changes) without leaving messages
unaffected by search.

6 years agoscripts/import_vger_from_mbox: perform mboxrd or mboxo escaping
Eric Wong (Contractor, The Linux Foundation) [Tue, 6 Mar 2018 03:51:08 +0000 (03:51 +0000)]
scripts/import_vger_from_mbox: perform mboxrd or mboxo escaping

It appears most of the mboxes in the archive I've been given are
mboxrd (despite having Content-Length:) and needs the escaping.

6 years agoimport: fall back to Sender for extracting name and email
Eric Wong (Contractor, The Linux Foundation) [Tue, 6 Mar 2018 03:49:42 +0000 (03:49 +0000)]
import: fall back to Sender for extracting name and email

This seems like a reasonable course of action for old messages.
Cc: Nicolás Ojeda Bär <n.oje.bar@gmail.com>
6 years agofavor Received: date over Date: header globally
Eric Wong (Contractor, The Linux Foundation) [Tue, 6 Mar 2018 04:15:38 +0000 (04:15 +0000)]
favor Received: date over Date: header globally

The first Received: header is believable since it typically
hits the user's mail server and can be treated as relatively
trustworthy.  We still show the Date: in per-message (permalink)
views, which may expose users for having incorrect Date:
headers, but all the ISO YYYY-MM-DD dates we display will
match what we see.

6 years agov2writable: remove unnecessary skeleton commit
Eric Wong (Contractor, The Linux Foundation) [Tue, 6 Mar 2018 02:59:35 +0000 (02:59 +0000)]
v2writable: remove unnecessary skeleton commit

Not a big deal since we still commit to the skeleton for every
single partition (barrier work abandoned).

6 years agosearch: each_smsg_by_mid uses skeleton if available
Eric Wong (Contractor, The Linux Foundation) [Mon, 5 Mar 2018 23:13:47 +0000 (23:13 +0000)]
search: each_smsg_by_mid uses skeleton if available

We do not need the large DBs for MID scans.

6 years agosearch: favor skeleton DB for lookup_mail
Eric Wong (Contractor, The Linux Foundation) [Sun, 4 Mar 2018 20:04:29 +0000 (20:04 +0000)]
search: favor skeleton DB for lookup_mail

The skeleton DB is smaller and hit more frequently given the
homepage and per-message/thread views; so it will be hotter in
the page cache.

6 years agoINSTALL: document more optional dependencies
Eric Wong (Contractor, The Linux Foundation) [Mon, 5 Mar 2018 17:06:46 +0000 (17:06 +0000)]
INSTALL: document more optional dependencies

I've missed a few things over time :x

6 years agov2: avoid redundant/repeated configs for git partition repos
Eric Wong (Contractor, The Linux Foundation) [Sat, 3 Mar 2018 20:56:15 +0000 (20:56 +0000)]
v2: avoid redundant/repeated configs for git partition repos

We'll let the config of all.git dictate every other subrepo to
ease maintenance and configuration.  The "include" directive has
been supported since git 1.7.10, so it's safe to depend on as v2
requires git 2.6.0+ anyways for "get-mark" in fast-import.

6 years agoimport: consolidate object info for v2 imports
Eric Wong (Contractor, The Linux Foundation) [Sat, 3 Mar 2018 20:33:25 +0000 (20:33 +0000)]
import: consolidate object info for v2 imports

It's easier to store everything in one array ref similar
to what our Git->check routine returns

6 years agosearchidx: store the primary MID in doc data for NNTP
Eric Wong (Contractor, The Linux Foundation) [Sat, 3 Mar 2018 20:21:05 +0000 (20:21 +0000)]
searchidx: store the primary MID in doc data for NNTP

We can't rely on header order for Message-ID after all
since we fall back to existing MIDs if they exist and
are unseen.  This lets us use SearchMsg->mid to get the
MID we associated with the NNTP article number to ensure
all NNTP article lookups roundtrip correctly.

6 years agonntp: fix NEWNEWS command
Eric Wong (Contractor, The Linux Foundation) [Sat, 3 Mar 2018 20:18:34 +0000 (20:18 +0000)]
nntp: fix NEWNEWS command

I guess nobody uses this command (slrnpull does not), and
the breakage was not noticed until I started writing new
tests for multi-MID handling.

Fixes: 3fc411c772a21d8f ("search: drop pointless range processors for Unix timestamp")
6 years agonntp: use NNTP article numbers for lookups
Eric Wong (Contractor, The Linux Foundation) [Sat, 3 Mar 2018 18:47:47 +0000 (18:47 +0000)]
nntp: use NNTP article numbers for lookups

Since Message-IDs are no longer unique within Xapian
(but are within the SQLite Msgmap); favor NNTP article
numbers for internal lookups.  This will prevent us
from finding the "wrong" internal Message-ID.

6 years agomid: truncate excessively long MIDs early
Eric Wong (Contractor, The Linux Foundation) [Sat, 3 Mar 2018 17:57:57 +0000 (17:57 +0000)]
mid: truncate excessively long MIDs early

Since we support duplicate MIDs in v2, we can safely truncate
long MID terms in the database and let other normal duplicate
resolution sort it out.  It seems only spammers use excessively
long MIDs, and there'll always be abuse/misuse vectors for causing
mis-threaded messages, so it's not worth worrying about
excessively long MIDs.

6 years agosearchidx: add NNTP article number as a searchable term
Eric Wong (Contractor, The Linux Foundation) [Sat, 3 Mar 2018 17:42:20 +0000 (17:42 +0000)]
searchidx: add NNTP article number as a searchable term

Since we support duplicate MIDs in v2, the NNTP article number
becomes the true unique identifier and we want a way to do fast
lookups on it.

While we're at it, stop putting XPATH in the term partitions
since we only need it in the skeleton DB.

6 years agosearchidx: use add_boolean_term for internal terms
Eric Wong (Contractor, The Linux Foundation) [Sat, 3 Mar 2018 17:26:16 +0000 (17:26 +0000)]
searchidx: use add_boolean_term for internal terms

Aside from the Message-Id ('Q'), these terms do not appear in
content and thus have no business contributing to the Xapian
document length.

Thanks-to Olly Betts for the tip on xapian-discuss
<20180228004400.GU12724@survex.com>

6 years agov2writable: generated Message-ID goes first
Eric Wong (Contractor, The Linux Foundation) [Sat, 3 Mar 2018 07:31:54 +0000 (07:31 +0000)]
v2writable: generated Message-ID goes first

This is to make SearchMsg behave more sanely under NNTP.

6 years agosearchidxskeleton: add a note about locking
Eric Wong (Contractor, The Linux Foundation) [Sat, 3 Mar 2018 07:16:29 +0000 (07:16 +0000)]
searchidxskeleton: add a note about locking

It's tempting to rely on the atomicity of smaller-than-PIPE_BUF
writes, but it doesn't work if mixed with larger ones.

6 years agosearchidx: avoid excessive XNQ indexing with diffs
Eric Wong (Contractor, The Linux Foundation) [Sat, 3 Mar 2018 05:55:26 +0000 (05:55 +0000)]
searchidx: avoid excessive XNQ indexing with diffs

When indexing diffs, we can avoid indexing the diff parts under
XNQ and instead combine the parts in the read-only search
interface.  This results in better indexing performance and
10-15% smaller Xapian indices.

6 years agomid: be strict with References, but loose on Message-Id
Eric Wong (Contractor, The Linux Foundation) [Sat, 3 Mar 2018 05:14:33 +0000 (05:14 +0000)]
mid: be strict with References, but loose on Message-Id

Traditionally we've been more lax on parsing Message-Id
and allow it without the angle brackets.  We've always been
strict on References and can't have it be pointlessly
large when some MUA decides to use HTML-escaped angle
brackets ("&lt;", "&gt;").

6 years agosearchidx: support indexing multiple MIDs
Eric Wong (Contractor, The Linux Foundation) [Sat, 3 Mar 2018 04:00:09 +0000 (04:00 +0000)]
searchidx: support indexing multiple MIDs

It's possible to have a message handle multiple terms;
so use this feature to ensure messages with multiple MIDs
can be found by either one.

6 years agosearch: revert to using 'Q' as a uniQue id per-Xapian conventions
Eric Wong (Contractor, The Linux Foundation) [Fri, 2 Mar 2018 20:46:55 +0000 (20:46 +0000)]
search: revert to using 'Q' as a uniQue id per-Xapian conventions

'Q' is merely a convention in the Xapian world, and is close
enough to unique for practical purposes, so stop using XMID
and gain a little more term length as a result.

6 years agov2writable: inject new Message-IDs on true duplicates
Eric Wong (Contractor, The Linux Foundation) [Fri, 2 Mar 2018 19:32:19 +0000 (19:32 +0000)]
v2writable: inject new Message-IDs on true duplicates

Since we'll need to support multiple Message-IDs anyways,
inject a new one if we hit a duplicate (or don't get one at
all).

Try to use a deterministic Message-Id for consistency, but give
up determinism and use a random Message-Id if an "attacker"
wants to prevent their message from being archived.

6 years agocontent_id: no need to be human-friendly
Eric Wong (Contractor, The Linux Foundation) [Fri, 2 Mar 2018 18:27:54 +0000 (18:27 +0000)]
content_id: no need to be human-friendly

We merely use this for internal comparisons and do not store
this in Xapian.  So using a shorter, non-human readable digest
is enough.  Furthermore, introduce "content_digest" which
returns the Digest::SHA object for extra changes.

6 years agosearchidx: use new `references' method for parsing References
Eric Wong (Contractor, The Linux Foundation) [Fri, 2 Mar 2018 09:53:11 +0000 (09:53 +0000)]
searchidx: use new `references' method for parsing References

It's shorter and more convenient, here.

6 years agocontent_id: use `mids' and `references' for MID extraction
Eric Wong (Contractor, The Linux Foundation) [Fri, 2 Mar 2018 09:39:31 +0000 (09:39 +0000)]
content_id: use `mids' and `references' for MID extraction

These already take care of deduping internally, so we'll save
ourselves at least some of the trouble while using a more
consistent API.  While we're at it, hash the header name as
well, since we need to distinguish which header a certain value
came from.

6 years agomid: add `mids' and `references' methods for extraction
Eric Wong (Contractor, The Linux Foundation) [Fri, 2 Mar 2018 09:38:35 +0000 (09:38 +0000)]
mid: add `mids' and `references' methods for extraction

We'll be using a more consistent API for extracting Message-IDs
from various headers.

6 years agoevcleanup: do not create event loop if nothing was registered
Eric Wong (Contractor, The Linux Foundation) [Fri, 2 Mar 2018 03:43:30 +0000 (03:43 +0000)]
evcleanup: do not create event loop if nothing was registered

This was creating an unnecessary epoll descriptor via
Danga::Socket when using V2Writable to import a mbox.  That
said, there should probably be better way of detecting whether
or not we're inside a Danga::Socket event loop.

Fixes: 427245acacaf04a8
       ("evcleanup: ensure deferred close from timers are handled ASAP")

6 years agov2writable: deduplicate detection on add
Eric Wong (Contractor, The Linux Foundation) [Fri, 2 Mar 2018 03:39:09 +0000 (03:39 +0000)]
v2writable: deduplicate detection on add

This is a bit expensive in a multi-process situation because
we need to make our indices and packs visible to the read-only
pieces.

6 years agoevcleanup: disable outside of daemon
Eric Wong (Contractor, The Linux Foundation) [Fri, 2 Mar 2018 03:12:23 +0000 (03:12 +0000)]
evcleanup: disable outside of daemon

We'll be using these in a more OO manner for V2Writable
(which doesn't use Danga::Socket), so lets not unnecessarily
register cleanup handlers intended for network daemons.

6 years agocontent_id: special treatment for Message-Id headers
Eric Wong (Contractor, The Linux Foundation) [Fri, 2 Mar 2018 03:08:33 +0000 (03:08 +0000)]
content_id: special treatment for Message-Id headers

Some emails in LKML archives are identical with the only
difference being s/References:/In-Reply-To:/ in the headers.
Since this difference doesn't affect how we handle message
threading, we will treat them the same way for the purposes
of deduplication.

There may be more changes to how we do content_id along these
lines (e.g. using msg_iter to walk the message).

6 years agosearchidx: add PID to error message when die-ing
Eric Wong (Contractor, The Linux Foundation) [Fri, 2 Mar 2018 00:50:56 +0000 (00:50 +0000)]
searchidx: add PID to error message when die-ing

6 years agosearch: remove informational "warning" message
Eric Wong (Contractor, The Linux Foundation) [Fri, 2 Mar 2018 00:49:51 +0000 (00:49 +0000)]
search: remove informational "warning" message

It was making imports too noisy.

6 years agov2writable: delete ::Import obj when ->done
Eric Wong (Contractor, The Linux Foundation) [Thu, 1 Mar 2018 08:24:00 +0000 (08:24 +0000)]
v2writable: delete ::Import obj when ->done

As with the ::Import class this wraps, we want this to be
usable as a checkpoint and be able to call ->add afterwards.
We'll be relying on ->done to flush changes through all
partition and skeleton DBs for deduplication checks.

6 years agov2/ui: get nntpd and init tests running on v2
Eric Wong (Contractor, The Linux Foundation) [Wed, 28 Feb 2018 22:29:38 +0000 (22:29 +0000)]
v2/ui: get nntpd and init tests running on v2

A work-in-progress, but it appears the v2 UI pieces do
will not require a lot of work to do.

6 years agosearch: query_xover uses skeleton DB iff available
Eric Wong (Contractor, The Linux Foundation) [Tue, 27 Feb 2018 08:29:09 +0000 (08:29 +0000)]
search: query_xover uses skeleton DB iff available

The skeleton DB is where we store all the information needed
for NNTP overviews via XOVER.  This seems to be the only change
necessary (besides eventually handling duplicates) necessary
to support our nntpd interface for v2 repositories.

6 years agosearchidx: do not modify Xapian DB while iterating
Eric Wong (Contractor, The Linux Foundation) [Tue, 27 Feb 2018 20:25:23 +0000 (20:25 +0000)]
searchidx: do not modify Xapian DB while iterating

Iterating through a list of documents while modifying them does
not seem to be supported in Xapian and it can trigger
DatabaseCorruptError exceptions.  This only worked with past
datasets out of dumb luck.  With the work-in-progress "v2"
public-inbox layout, this problem might become more visible
as the "thread skeleton" is partitioned out to a separate,
smaller Xapian database.

I've reproduced the problem on both Debian 8.x and 9.x with
Xapian 1.2.19 (chert backend) and 1.4.3 (glass backend)
respectively.

6 years agosearchidxskeleton: extra error checking
Eric Wong (Contractor, The Linux Foundation) [Wed, 28 Feb 2018 17:37:00 +0000 (17:37 +0000)]
searchidxskeleton: extra error checking

I added these while chasing down the DatabaseCorruptError
exceptions which turned out to be caused by Xapian DB
modifications during iteration.

6 years agov2writable: commit to skeleton via remote partitions
Eric Wong (Contractor, The Linux Foundation) [Tue, 27 Feb 2018 20:29:55 +0000 (20:29 +0000)]
v2writable: commit to skeleton via remote partitions

We need to ensure Xapian transaction commits are made to remote
partitions before associated commits hit the skeleton DB.

This causes unnecessary commits to be made to the skeleton DB;
but they're mostly harmless.  Further work will be necessary
to ensure proper ordering and avoidance of unnecessary commits.

6 years agorename SearchIdxThread to SearchIdxSkeleton
Eric Wong (Contractor, The Linux Foundation) [Tue, 27 Feb 2018 00:41:21 +0000 (00:41 +0000)]
rename SearchIdxThread to SearchIdxSkeleton

Interchangably using "all", "skel", "threader", etc. were
confusing.  Standardize on the "skeleton" term to describe
this class since it's also used for retrieval of basic headers.

6 years agosearch: use different Enquire object for skeleton queries
Eric Wong (Contractor, The Linux Foundation) [Mon, 26 Feb 2018 23:42:14 +0000 (23:42 +0000)]
search: use different Enquire object for skeleton queries

A different Xapian DB requires the use of a different Enquire
object.  This is necessary for get_thread and thread skeleton
to work in the PSGI UI.

6 years agosearchidx: index values in the threader
Eric Wong (Contractor, The Linux Foundation) [Mon, 26 Feb 2018 23:41:11 +0000 (23:41 +0000)]
searchidx: index values in the threader

We will need timestamp, YYYYMMDD, article number, and line count
for querying thread information (including XOVER for NNTP).

6 years agosearch: reopen skeleton DB as well
Eric Wong (Contractor, The Linux Foundation) [Mon, 26 Feb 2018 23:25:52 +0000 (23:25 +0000)]
search: reopen skeleton DB as well

Any Xapian DB is subject to the same errors and retries.
Perhaps in the future this can made more granular to avoid
unnecessary reopens.

6 years agosearchidxpart: force integers into add_message
Eric Wong (Contractor, The Linux Foundation) [Mon, 26 Feb 2018 23:02:13 +0000 (23:02 +0000)]
searchidxpart: force integers into add_message

Make data passed via Storable to the skeleton worker
a little neater.

6 years agosearchidxthread: load doc data for references
Eric Wong (Contractor, The Linux Foundation) [Sat, 24 Feb 2018 06:58:55 +0000 (06:58 +0000)]
searchidxthread: load doc data for references

Otherwise, references and thread linking doesn't happen
across subject mismatches.  Oops, this is important.

6 years agoview: remove X-PI-TS reference
Eric Wong (Contractor, The Linux Foundation) [Sat, 24 Feb 2018 03:33:59 +0000 (03:33 +0000)]
view: remove X-PI-TS reference

We haven't needed this since we integrated threading
and dropped Email::Abstract and Mail::Thread usage.

6 years agosearchidx: get rid of pointless index_blob wrapper
Eric Wong (Contractor, The Linux Foundation) [Sat, 24 Feb 2018 00:40:09 +0000 (00:40 +0000)]
searchidx: get rid of pointless index_blob wrapper

This used to lookup the message in git, but no longer, so
remove a needless indirection layer and call add_message
directly.

6 years agosearchidx*: name child subprocesses
Eric Wong (Contractor, The Linux Foundation) [Sat, 24 Feb 2018 00:29:51 +0000 (00:29 +0000)]
searchidx*: name child subprocesses

This makes viewing "ps" output nicer.

6 years agosearchidxpart: chomp line before splitting
Eric Wong (Contractor, The Linux Foundation) [Sat, 24 Feb 2018 00:19:51 +0000 (00:19 +0000)]
searchidxpart: chomp line before splitting

This was adding a needless newline into doc_data

6 years agouse PublicInbox::MIME consistently
Eric Wong (Contractor, The Linux Foundation) [Fri, 23 Feb 2018 18:33:34 +0000 (18:33 +0000)]
use PublicInbox::MIME consistently

It works around some bugs in older Email::MIME which we'll
find useful.

6 years agosearchidxpart: binmode
Eric Wong (Contractor, The Linux Foundation) [Fri, 23 Feb 2018 02:28:53 +0000 (02:28 +0000)]
searchidxpart: binmode

Probably unnecessary, but set binmode for consistency across
platforms.

6 years agov2writable: cleanup unused pipes in partitions
Eric Wong (Contractor, The Linux Foundation) [Fri, 23 Feb 2018 02:26:45 +0000 (02:26 +0000)]
v2writable: cleanup unused pipes in partitions

Leaking these pipes to child processes wasn't harmful, but
made determining relationships and dataflow between processes
more confusing.

6 years agov2/ui: retry DB reopens in a few more places
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 21:17:53 +0000 (21:17 +0000)]
v2/ui: retry DB reopens in a few more places

Relying more on Xapian requires retrying reopens in more
places to ensure it does not fall down and show errors to
the user.

6 years agov2/ui: some hacky things to get the PSGI UI to show up
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 07:15:54 +0000 (07:15 +0000)]
v2/ui: some hacky things to get the PSGI UI to show up

Fortunately, Xapian multiple database support makes things
easier but we still need to handle the skeleton DB separately.

6 years agov2writable: warn on duplicate Message-IDs
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 19:10:31 +0000 (19:10 +0000)]
v2writable: warn on duplicate Message-IDs

This should give us an idea of how much a problem deduplication
will be.

6 years agosearchidxpart: increase pipe size for partitions
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 17:55:37 +0000 (17:55 +0000)]
searchidxpart: increase pipe size for partitions

We want to reduce the time in the main V2Writable process
spends writing to the pipe, as the main process itself is
the primary source of contention.

While we're at it, always flush after writing to ensure
the child sees it at once.  (Grr... Perl doesn't use writev)

6 years agov2writable: round-robin to partitions based on article number
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 17:55:35 +0000 (17:55 +0000)]
v2writable: round-robin to partitions based on article number

Instead of relying on the git object_id hash to partition,
round-robin to these partitions based on the NNTP article
number.  This reduces the partition pipes as a source of
contention when two (or more) sequential messages end up
going to the same partition.

6 years agov2: parallelize Xapian indexing
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 01:49:08 +0000 (01:49 +0000)]
v2: parallelize Xapian indexing

The parallelization requires splitting Msgmap, text+term
indexing, and thread-linking out into separate processes.

git-fast-import is fast, so we don't bother parallelizing it.

Msgmap (SQLite) and thread-linking (Xapian) must be serialized
because they rely on monotonically increasing numbers (NNTP
article number and internal thread_id, respectively).

We handle msgmap in the main process which drives fast-import.
When the article number is retrieved/generated, we write the
entire message to per-partition subprocesses via pipes for
expensive text+term indexing.

When these per-partition subprocesses are done with the
expensive text+term indexing, they write SearchMsg (small data)
to a shared pipe (inherited from the main V2Writable process)
back to the threader, which runs its own subprocess.

The number of text+term Xapian partitions is chosen at import
and can be made equal to the number of cores in a machine.

V2Writable --> Import -> git-fast-import
           \-> SearchIdxThread -> Msgmap (synchronous)
           \-> SearchIdxPart[n] -> SearchIdx[*]
   \-> SearchIdxThread -> SearchIdx ("threader", a subprocess)

[* ] each subprocess writes to threader

6 years agoimport_vger_from_mbox: use PublicInbox::MIME and avoid clobbering
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 17:55:36 +0000 (17:55 +0000)]
import_vger_from_mbox: use PublicInbox::MIME and avoid clobbering

It is less confusing without the clobber assignment; and
PublicInbox::MIME exists to workaround bugs in older
Email::MIME (which is in Debian 9 (stretch))

6 years agoimport_vger_from_inbox: allow "-V" option
Eric Wong (Contractor, The Linux Foundation) [Thu, 22 Feb 2018 05:17:40 +0000 (05:17 +0000)]
import_vger_from_inbox: allow "-V" option

This will let us quickly test between v2 and v1 inboxes.

6 years agov2: support Xapian + SQLite indexing
Eric Wong (Contractor, The Linux Foundation) [Tue, 20 Feb 2018 21:00:21 +0000 (21:00 +0000)]
v2: support Xapian + SQLite indexing

This is too slow, currently.  Working with only 2017 LKML
archives:

         git-only: ~1 minute
     git + SQLite: ~12 minutes
git+Xapian+SQlite: ~45 minutes

So yes, it looks like we'll need to parallelize Xapian indexing,
at least.

6 years agogit: reload alternates file on missing blob
Eric Wong (Contractor, The Linux Foundation) [Mon, 19 Feb 2018 20:07:11 +0000 (20:07 +0000)]
git: reload alternates file on missing blob

Since we'll be adding new repositories to the `alternates' file
in git, we must restart the `git cat-file --batch' process as
git currently does not detect changes to the alternates file
in long-running cat-file processes.

Don't bother with the `--batch-check' process since we won't be
using it with v2.

6 years agov2writable: initial cut for repo-rotation
Eric Wong (Contractor, The Linux Foundation) [Sat, 17 Feb 2018 10:19:47 +0000 (10:19 +0000)]
v2writable: initial cut for repo-rotation

Wrap the old Import package to enable creating new repos based
on size thresholds.  This is better than relying on time-based
rotation as LKML traffic seems to be increasing.

6 years agowww: stop assuming mainrepo == git_dir
Eric Wong (Contractor, The Linux Foundation) [Fri, 16 Feb 2018 03:54:37 +0000 (03:54 +0000)]
www: stop assuming mainrepo == git_dir

It won't be in v2

6 years agosearch: stop assuming Message-ID is unique
Eric Wong (Contractor, The Linux Foundation) [Fri, 16 Feb 2018 02:59:11 +0000 (02:59 +0000)]
search: stop assuming Message-ID is unique

In general, they are, but there's no way for or general purpose
mail server to enforce that.  This is a step in allowing us
to handle more corner cases which existing lists throw at us.

6 years agoextmsg: fix broken Xapian MID lookup
Eric Wong (Contractor, The Linux Foundation) [Fri, 16 Feb 2018 00:17:16 +0000 (00:17 +0000)]
extmsg: fix broken Xapian MID lookup

This likely has no real world implications, though, as we
fall back to Msgmap lookups anyways.

Broken since commit 7eeadcb62729b0efbcb53cd9b7b181897c92cf9a
("search: remove unnecessary abstractions and functionality")

6 years agoimport: allow the epoch (0s) as a valid time
Eric Wong (Contractor, The Linux Foundation) [Thu, 15 Feb 2018 23:20:20 +0000 (23:20 +0000)]
import: allow the epoch (0s) as a valid time

Despite email not existing until 1971; "Jan 1, 1970 00:00:00"
seems like a common default timestamp for some test emails
to use as a Date: header.

6 years agoimport: quiet down warnings from bogus From: lines
Eric Wong (Contractor, The Linux Foundation) [Thu, 15 Feb 2018 09:27:55 +0000 (09:27 +0000)]
import: quiet down warnings from bogus From: lines

There's a lot of crap in archives and git-fast-import
accepts empty names and email addresses for authors
just fine.

6 years agoscripts/import_vger_from_mbox: use v2 layout for import
Eric Wong (Contractor, The Linux Foundation) [Thu, 15 Feb 2018 01:12:18 +0000 (01:12 +0000)]
scripts/import_vger_from_mbox: use v2 layout for import

Big lists are orders of magnitude more efficient with v2.

6 years agoimport: pass "raw" dates to git-fast-import(1)
Eric Wong (Contractor, The Linux Foundation) [Thu, 15 Feb 2018 01:10:06 +0000 (01:10 +0000)]
import: pass "raw" dates to git-fast-import(1)

For LKML, it appears we need an even more liberal parser than
RFC2822 date parser in git.  I have not validated Date::Parse
parses dates correctly, but this at least prevents
git-fast-import(1) from choking.

6 years agoaddress: extract more characters from email addresses
Eric Wong (Contractor, The Linux Foundation) [Thu, 15 Feb 2018 00:25:53 +0000 (00:25 +0000)]
address: extract more characters from email addresses

There's a lot of weird characters which show up in LKML archives
which we did not support before.  Furthermore, allow spaces
before the '>' in the From: line as at least some non-spam
poster used it.

6 years agosearchidx: fix comment around next_thread_id
Eric Wong (Contractor, The Linux Foundation) [Wed, 14 Feb 2018 08:20:38 +0000 (08:20 +0000)]
searchidx: fix comment around next_thread_id

I decided not to copy the notmuch implementation regarding
serialization of integers to Xapian metadata.

6 years agosearch: free up 'Q' prefix for a real unique identifier
Eric Wong (Contractor, The Linux Foundation) [Tue, 13 Feb 2018 03:02:56 +0000 (03:02 +0000)]
search: free up 'Q' prefix for a real unique identifier

This will allow easier-compatibility with v2 code which will
introduce content_id as the unique identifier.
The old "XMID" becomes "XM" as a free text searchable term.
"Q" becomes "XMID" as a boolean prefix.

There's no user-visible changes in this, but there needs to
be a schema version bump later on...
(more changes planned which can affect v1)

6 years agoimport: APIs to support v2 use
Eric Wong (Contractor, The Linux Foundation) [Wed, 14 Feb 2018 00:30:33 +0000 (00:30 +0000)]
import: APIs to support v2 use

Wrap "get-mark" and "checkpoint" commands for git-fast-import
while documenting/cementing parts of the API.

6 years agoscripts/import_vger_from_mbox: support --dry-run option
Eric Wong (Contractor, The Linux Foundation) [Tue, 13 Feb 2018 18:39:40 +0000 (18:39 +0000)]
scripts/import_vger_from_mbox: support --dry-run option

This can be useful for getting baseline of performance
of just Email::MIME and Date: header parsing.  We'll need
to do some Date: header parsing for LKML since there are
some wonky date formats which causes the git RFC822 parser
to choke.

6 years agosearchmsg: add mid_mime import for _extract_mid
Eric Wong (Contractor, The Linux Foundation) [Tue, 13 Feb 2018 02:58:56 +0000 (02:58 +0000)]
searchmsg: add mid_mime import for _extract_mid

Oops, I guess this code was never called and may not be
needed.  But for now, import it so it can run properly.

6 years agocontent_id: add test case
Eric Wong (Contractor, The Linux Foundation) [Mon, 12 Feb 2018 23:09:07 +0000 (23:09 +0000)]
content_id: add test case

6 years agot/import: test for last_object_id insertion
Eric Wong (Contractor, The Linux Foundation) [Mon, 12 Feb 2018 17:55:52 +0000 (17:55 +0000)]
t/import: test for last_object_id insertion

Check for this before doing the Xapian-based v2 importer.

6 years agoimport: initial handling for v2
Eric Wong (Contractor, The Linux Foundation) [Sat, 10 Feb 2018 05:13:19 +0000 (05:13 +0000)]
import: initial handling for v2

Call order will need to change a bit since this is going to be
tied to Xapian

6 years agoimport: begin supporting this without ssoma.lock
Eric Wong (Contractor, The Linux Foundation) [Fri, 9 Feb 2018 23:38:03 +0000 (23:38 +0000)]
import: begin supporting this without ssoma.lock

We'll reuse this class in v2, but won't be utilizing
per-git-repository ssoma.lock files.

Meanwhile, stop treating ::Inbox objects as an afterthought
and allow importing name and email into them.

6 years agoimport: stop writing legacy ssoma.index by default
Eric Wong (Contractor, The Linux Foundation) [Thu, 8 Feb 2018 17:21:36 +0000 (17:21 +0000)]
import: stop writing legacy ssoma.index by default

For machines which have never seen ssoma, they don't need the
index so stop creating it.

6 years agoscripts/import_vger_from_mbox: relax From_ line match slightly
Eric Wong (Contractor, The Linux Foundation) [Thu, 8 Feb 2018 03:49:51 +0000 (03:49 +0000)]
scripts/import_vger_from_mbox: relax From_ line match slightly

The mboxes I got from cregit have two spaces after the email
address, while the "git format-patch" output I'm used to dealing
with only has one space.

It's still a "strict" match in that it checks for something
resembling a timestamp, but it relaxes the number of spaces
between the email address and date.

6 years agowatch_maildir: allow '-' in mail filename
Eric Wong (Contractor, The Linux Foundation) [Thu, 8 Feb 2018 03:32:05 +0000 (03:32 +0000)]
watch_maildir: allow '-' in mail filename

Hostnames can contain '-' and this allows public-inbox-watch(1)
to work on machines which generate Maildir files with '-' in
them.

6 years agoAUTHORS: add The Linux Foundation
Eric Wong (Contractor, The Linux Foundation) [Thu, 8 Feb 2018 02:39:41 +0000 (02:39 +0000)]
AUTHORS: add The Linux Foundation

I'll be working as a contractor for The Linux Foundation on v2
in an effort to support LKML and associated lists.

6 years agopublic-inbox 1.0.0 v1.0.0
Eric Wong [Thu, 8 Feb 2018 02:25:19 +0000 (02:25 +0000)]
public-inbox 1.0.0

Might as well, this release is mostly to serve as a checkpoint
for the start of new development on v2 stuff mentioned in the
TODO.

6 years agoMANIFEST: add AUTHORS file
Eric Wong [Thu, 8 Feb 2018 02:24:45 +0000 (02:24 +0000)]
MANIFEST: add AUTHORS file

6 years agoadd AUTHORS file
Eric Wong [Wed, 7 Feb 2018 21:14:03 +0000 (21:14 +0000)]
add AUTHORS file

This can be useful for tarball distributions which lack full git
history.

6 years agoupdate copyrights for 2018
Eric Wong [Wed, 7 Feb 2018 19:56:45 +0000 (19:56 +0000)]
update copyrights for 2018

Using update-copyrights from gnulib

While we're at it, use the SPDX identifier for AGPL-3.0+ to
ease mechanical processing.

6 years agoview: allow expanding directly to "nested" view
Eric Wong [Sat, 3 Feb 2018 02:50:46 +0000 (02:50 +0000)]
view: allow expanding directly to "nested" view

Sometimes, it can be desirable to jump directly to the "nested"
view when viewing a thread skeleton.  This makes it possible.
While we're at it, shorten some of the text to ensure it still
fits in 80 columns.

6 years agoview: close <pre> in reply instructions
Eric Wong [Tue, 30 Jan 2018 18:17:47 +0000 (18:17 +0000)]
view: close <pre> in reply instructions

We leave the mailto: link out when obfuscating address, so
do not stuff the "</pre>" closing tag into it.  Instead,
keep the closing tag in the same context as the opening one,
making it easier to keep track of.

6 years agoreply: follow obfuscation rules for HTML in sh args
Eric Wong [Mon, 29 Jan 2018 13:04:09 +0000 (13:04 +0000)]
reply: follow obfuscation rules for HTML in sh args

Namely, we do not want to obfuscate the mail address of the
site itself.

6 years agoview: adjust wording for reply-to-list configs
Eric Wong [Mon, 29 Jan 2018 11:49:56 +0000 (11:49 +0000)]
view: adjust wording for reply-to-list configs

This makes the wording less confusing when showing archives
for lists where the convention is reply-to-list.
I still hate reply-to-list, but it's still better than no
archives or list at all.

6 years agoatom: show metadata before message body
Eric Wong [Fri, 26 Jan 2018 21:54:00 +0000 (21:54 +0000)]
atom: show metadata before message body

This can allow streaming parsers (SAX) to work a little more
efficiently as they can handle/discard all the metadata before
the big content.

6 years agodoc/design_www: adjust some wording and URLs around CSS
Eric Wong [Thu, 25 Jan 2018 06:30:03 +0000 (06:30 +0000)]
doc/design_www: adjust some wording and URLs around CSS

I still hate that CSS is over-used, but colors are useful
and perhaps using them for highlighting won't be too bad;
but user-supplied colors will ALWAYS be supported.

6 years agoTODO: notes about v2 format for giant archives
Eric Wong [Tue, 16 Jan 2018 22:18:16 +0000 (22:18 +0000)]
TODO: notes about v2 format for giant archives

Inspired by interest in LKML archival:

https://public-inbox.org/meta/d5546b24-5840-4ae9-d25b-5e3e737ed73b@linuxfoundation.org