couchdb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Filipe Manana (JIRA)" <j...@apache.org>
Subject [jira] Created: (COUCHDB-1088) Validate replication documents added to the replicator database
Date Thu, 10 Mar 2011 22:11:59 GMT
Validate replication documents added to the replicator database
---------------------------------------------------------------

                 Key: COUCHDB-1088
                 URL: https://issues.apache.org/jira/browse/COUCHDB-1088
             Project: CouchDB
          Issue Type: Improvement
          Components: Replication
    Affects Versions: 1.1
            Reporter: Filipe Manana
            Assignee: Filipe Manana


Currently we don't validate the replication documents added to the replicator database - we
don't check if mandatory fields (source and target) are present and if they have the right
type (string or object). We also don't check if optional fields, like "continuous" or "create_target",
have the right type - for example, often users specify the string "true" as the value for
those 2 fields when it should be a boolean.

The following patch adds some basic validation to the _replicator database default document
validation function. Besides throwing meaningful error messages to the user, it also adds
nice information in the log like for e.g.:

[info] [<0.3938.0>] OS Process #Port<0.35369> Log :: Error writing document `rep1'
to the replicator database: The `source' property must exist and be either a string or an
object.
[info] [<0.3887.0>] 127.0.0.1 - - PUT /test_suite_rep_db/rep1 403
[info] [<0.3938.0>] OS Process #Port<0.35369> Log :: Error writing document `rep1'
to the replicator database: The `continuous' field must be a boolean.
[info] [<0.3887.0>] 127.0.0.1 - - PUT /test_suite_rep_db/rep1 403
[info] [<0.3938.0>] OS Process #Port<0.35369> Log :: Error writing document `rep1'
to the replicator database: The `filter' field must be a non-empty string.


--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message