Skip to content

SG A 1.4 Support notes

Andrew Reslan edited this page Feb 28, 2017 · 18 revisions

Configuration

In 1.4 some configuration properties are exclusive to Sync Gateway and Sync Gateway Accelerator

Sync Gateway

The following properties are exclusive to Sync Gateway, where the enclosing configuration object is shown only the subset of properties listed are exclusive.

Top Level properties

{
    Interface
    SSLCert
    SSLKey
    ServerReadTimeout
    ServerWriteTimeout
    AdminUI
    ProfileInterface
    Facebook
    Google
    CORS
    MaxIncomingConnections
    CompressResponses
    Replications
    MaxHeartbeat
    Unsupported
}
"database": {
    Sync
    Users
    Roles
    RevsLimit
    ImportDocs
    Shadow
    EventHandlers
    FeedType
    AllowEmptyPassword
    CacheConfig
    RevCacheSize
    StartOffline
    OIDCConfig
    Unsupported
}

Sync Gateway Accelerator

The following properties are exclusive to Sync Gateway Accelerator, where the enclosing configuration object is shown only the subset of properties listed are exclusive.

"cluster_config":{
    "server":"http://127.0.0.1:8091",
    "data_dir":".",
    "bucket":"data-bucket"
}
"channel_index":{
    "num_shards": 2
}

GitHub issues for SyncGateway, Sync Gateway Accel and Mobile Test Kit

Logging

In SG/A 1.4, support for log rotation has been built into the the SG/A binaries, to configure log rotation a new "logging" config object has been added to the top level object.

Previous versions of SG/A supported the top level properties of "log" and "logFilePath", these are still functional but should be regarded as deprecated. The plan is to remove support for these properties in SG/A 2.0.

If the "logging" object is present in the SG/A configuration, it will take precedence over the old configuration options.

The "logging" object structure is as follows:

"logging" : {
    "default" : {
      	"logFilePath":"PATH_TO_LOG_FILE",
      	"logKeys":["*"],
      	"logLevel":"debug",
      	"rotation":{
            "maxsize":100,
            "maxage":30,
            "maxbackups":5,
            "localtime":true
        }
    }
}

The "logging" object must contain exactly one property called "default" which has an object value.

"logFilePath" points to the path of the base log file "logKeys" configures which log channels are rendered to the log "logLevel" defines the level of log entries to render "maxsize" defined the maximum size of the base log file before it is rotated out of the way "maxage" The maximum age of rotated log files before they are deleted "maxbackups" The maximum number of old log files to keep "localtime" the timestamp format to use on rotated log files

New log keys

New log keys have been introduced in 1.4 for SG/A

  1. DIndex+
  2. ChannelStorage+

New Log messages

DIndex+

Sync Gateway
Error Mesage Severity Description
Error getting count:

|No clock found for channel %s, assuming no entries in index", channelName|||

|getOrCreateReader: Created new reader for channel %s", channelName|||

|getOrCreateReader: Using existing reader for channel %s", channelName|||

|No existing channel clock for key %s:%v. Using empty channel clock", key, err|||

|Error unmarshalling channel clock for channel %s, clock value %v", k.channelName, value|||

|Unable to find existing channel clock for channel %s - treating as new", k.channelName|||

|Add to channel index [%s], vbNo=%d, isRemoval:%v", b.channelName, entry.VbNo, entry.IsRemoved()|||

|Invalid Range for block [%s] (from, to): (%d, %d). MinSeq:%d", b.Key(), fromSeq, toSeq, b.value.MinSequence|||

|Invalid Range for block (from, to): (%d, %d). MinSeq:%d", fromSeq, toSeq, b.minSequence|||

|CAS fail - reapplying changes for hash storage for key: %s|||

|Reattempting stored hash write for key %s:", key|||

Sync Gateway Accelerator

Adding set of %d entries to channel %s", len(entries), k.channelName

Unable to find existing channel clock for channel %s - treating as new", k.channelName

Received #%d after %3dms (%q / %q)", logEntry.Sequence, int(feedLag/time.Millisecond), logEntry.DocID, logEntry.RevID

StaleHeartBeatDetected for node: %v", nodeUuid

Telling CBGT to remove node: %v (kind: %v, cbgt version: %v)", nodeUuid, kind, h.CbgtVersion

ChannelStorage+

Sync Gateway

Block full - returning entries as overflow. #entries:[%d]", len(entries)

Error adding entries to block. %v", err

CAS error writing block to database. %v", err

Successfully added set to block. key:[%s] #added:[%d] #overflow:[%d] #pendingRemoval:[%d]", d.Key, len(entries)-len(overflow), len(overflow), len(pendingRemoval)

Error adding entry to block. key:[%s] error:%v", entry.DocID, err

Index already has entries later than or matching sequence - skipping. key:[%s] seq:[%d] index_seq[%d] blockKey:[%s]", logEntry.DocID, logEntry.Sequence, clockSequence, d.Key

Error writing block to database. %v", err

Successfully removed set from block. key:[%s] #removed:[%d] #pending:[%d]", d.Key, len(entries)-len(pendingRemoval), len(pendingRemoval)

Error writing block to database. %v", err

Successfully removed entries from block during rollback. key:[%s] #removed:[%d] complete?:[%v]", d.Key, numRemoved, rollbackComplete

Adding block to list. channel:[%s] partition:[%d] index:[%d]", l.channelName, l.partition, nextIndex

Successfully added block to list. channel:[%s] partition:[%d] index:[%d]", l.channelName, l.partition, nextIndex

Creating new block list. channel:[%s] partition:[%d] cas:[%d]", l.channelName, l.partition, l.activeCas

Unexpected error attempting to retrieve active block list. key:[%s] err:[%v]", l.activeKey, readError

No block found for requested partition range. channel:[%s] partition:[%d]", r.channelName, r.partitionNo

Sync Gateway Accelerator

Adding entry set to partition storage. channel:[%s] partition:[%d] #entries:[%d]", dps.channelName, dps.partitionNo, len(entries)

Block overflow, adding new block. channel:[%s] partition:[%d] block:[%s] count:[%d] #overflow:[%d]", dps.channelName, dps.partitionNo, dps.getActiveBlock().Key, dps.getActiveBlock().Count(), len(overflow)

gscollect_info.exe

sgcollect_info.exe has been updated for 1.4 to capture the base log file defined by the logFilePath property as well as any historical timestamped versions for the base log file.

General changes to behavior

Sync Gateway Accelerator uses CBGT which will create multiple directories in the execution directory with the following naming format:

data-bucket<HASH>.pindex

Troubleshooting

Index Bucket files

The Index bucket contains files with the following key formats, their function is described below:

_idx:blist:p10:A

_idx:block0:p10:A

_idx:chClock:A

_idx:rbClock:p10:A

_idxPartitionMap

_idx_c:_idx_stableSeq:clock-10

_idx_checkpoint:0

_sequence:1

TBC

Issues targeted for 1.4.1 Milestone

https://github.com/couchbaselabs/sync-gateway-accel/issues/17 https://github.com/couchbaselabs/sync-gateway-accel/issues/85 https://github.com/couchbaselabs/sync-gateway-accel/issues/92

Clone this wiki locally