Skip to content

SG A 1.4 Support notes

Andrew Reslan edited this page Mar 2, 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+

Error Mesage Severity Context
Error getting count: Warning Unable to increment bucket based counter
No clock found for channel %s, assuming no entries in index Info Unable to get clock for a given channel
getOrCreateReader: Created new reader for channel %s Info no reader found for given channel name
getOrCreateReader: Using existing reader for channel %s Info reader found for given channel name
No existing channel clock for key %s:%v. Using empty channel clock Info no clock found for given channel name
Error unmarshalling channel clock for channel %s, clock value %v Warn failed to unmarshal clock for channel
Unable to find existing channel clock for channel %s - treating as new Info no clock found for given channel name
Add to channel index [%s], vbNo=%d, isRemoval:%v Info Adding new entry sequence in a cache block
Invalid Range for block [%s] (from, to): (%d, %d). MinSeq:%d Warn Failed range validation against block bounds
Invalid Range for block (from, to): (%d, %d). MinSeq:%d Warn Failed range validation against block bounds
CAS fail - reapplying changes for hash storage for key: %s Info CAS check failed when writing hash
Reattempting stored hash write for key %s: Info hash write retry
Adding set of %d entries to channel %s Info Adding set of entries to channel
Received #%d after %3dms (%q / %q) Info Channel index writer processing doc revision
StaleHeartBeatDetected for node: %v Info CBGT cluster stale heartbeat detected
Telling CBGT to remove node: %v (kind: %v, cbgt version: %v) Info removing node with stale heartbeat from CBGT

ChannelStorage+

Sync Gateway
Error Mesage Severity Description
Block full - returning entries as overflow. #entries:[%d] Info Block is already full, return all entries as overflow
Error adding entries to block. %v Warn Error adding entries - reset the block and return error
CAS error writing block to database. %v Warn CAS write failure
Successfully added set to block. key:[%s] #added:[%d] #overflow:[%d] #pendingRemoval:[%d] Info Set added successfully
Error adding entry to block. key:[%s] error:%v Error Unable to write entry to dense block
Index already has entries later than or matching sequence - skipping. key:[%s] seq:[%d] index_seq[%d] blockKey:[%s] Info Ensure entry hasn't already been written by another writer
Error writing block to database. %v Error Attempting to remove entires from block
Successfully removed set from block. key:[%s] #removed:[%d] #pending:[%d] Info completed removing entries from block
Successfully removed entries from block during rollback. key:[%s] #removed:[%d] complete?:[%v] Info Completed removing entries during a rollback
Adding block to list. channel:[%s] partition:[%d] index:[%d] Info About to add block to list
Successfully added block to list. channel:[%s] partition:[%d] index:[%d] Info Completed adding block to list
Creating new block list. channel:[%s] partition:[%d] cas:[%d] Info Initialising dense block list
Unexpected error attempting to retrieve active block list. key:[%s] err:[%v] Error Error loading dense block list
No block found for requested partition range. channel:[%s] partition:[%d] Warn Unable to find blocks in the requested range
Adding entry set to partition storage. channel:[%s] partition:[%d] #entries:[%d] Info Adding entry set to partition storage
Block overflow, adding new block. channel:[%s] partition:[%d] block:[%s] count:[%d] #overflow:[%d] Info Current channel storage block full

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

Data Collection

To debug the majority of issues the following log settings are recommended:

log tags/keys

When using channel index

["HTTP","DCP","Cache","Cache+","CRUD","Changes"]

When using distributed index

["DIndex+","ChannelStorage+","ChannelIndex","DCP"]

max log size before rotation

100 MBytes

max backups to keep

200

Required disk space

20 GBytes

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

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

References

Clone this wiki locally