[SERVER-4760] Add commands for fsyncUnlock and fsyncIsLocked Created: 24/Jan/12  Updated: 11/Aug/15  Resolved: 23/Mar/15

Status: Closed
Project: Core Server
Component/s: Shell
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Daniel Pasette (Inactive) Assignee: Adam Midvidy
Resolution: Duplicate Votes: 1
Labels: neweng
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-7775 Make special commands (inprog, killop... Closed
Participants:

 Description   

Currently fsyncUnlock is implemented as a query on the $cmd.sys.unlock collection in the admin database, and checking to see if the server is locked is implemented as a query on the $cmd.sys.inprog collection. In the continuing effort to rid clients of code that involves operations on special collections, the server should expose explicit commands to support these features.



 Comments   
Comment by Scott Hernandez (Inactive) [ 24/Jan/12 ]

This isn't a server command:

>db.fsyncUnlock
function () {
    return db.getSiblingDB("admin").$cmd.sys.unlock.findOne();
}
> db.help()
DB methods:
	db.addUser(username, password[, readOnly=false])
	db.auth(username, password)
	db.cloneDatabase(fromhost)
	db.commandHelp(name) returns the help for the command
	db.copyDatabase(fromdb, todb, fromhost)
	db.createCollection(name, { size : ..., capped : ..., max : ... } )
	db.currentOp() displays the current operation in the db
	db.dropDatabase()
	db.eval(func, args) run code server-side
	db.getCollection(cname) same as db['cname'] or db.cname
	db.getCollectionNames()
	db.getLastError() - just returns the err msg string
	db.getLastErrorObj() - return full status object
	db.getMongo() get the server connection object
	db.getMongo().setSlaveOk() allow this connection to read from the nonmaster member of a replica pair
	db.getName()
	db.getPrevError()
	db.getProfilingLevel() - deprecated
	db.getProfilingStatus() - returns if profiling is on and slow threshold 
	db.getReplicationInfo()
	db.getSiblingDB(name) get the db at the same server as this one
	db.isMaster() check replica primary status
	db.killOp(opid) kills the current operation in the db
	db.listCommands() lists all the db commands
	db.logout()
	db.printCollectionStats()
	db.printReplicationInfo()
	db.printSlaveReplicationInfo()
	db.printShardingStatus()
	db.removeUser(username)
	db.repairDatabase()
	db.resetError()
	db.runCommand(cmdObj) run a database command.  if cmdObj is a string, turns it into { cmdObj : 1 }
	db.serverStatus()
	db.setProfilingLevel(level,<slowms>) 0=off 1=slow 2=all
	db.shutdownServer()
	db.stats()
	db.version() current version of the server
	db.getMongo().setSlaveOk() allow queries on a replication slave server
	db.fsyncLock() flush data to disk and lock server for backups
	db.fsyncUnlock() unlocks server following a db.fsyncLock()
 

We can make this a server command, is that what you mean?

Generated at Thu Feb 08 03:06:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.