Permalink
Browse files

remove explict vacuum full when below quota

Change-Id: I430286d0ddadf28e3db31b1262dede0eaade9440
  • Loading branch information...
1 parent 8a4f290 commit c68bd8028b5f38d5e39dc60e46d626023769e7d3 Frank Lu committed Nov 15, 2012
@@ -377,7 +377,7 @@ def create_database_user(instance, binduser, quota_exceeded)
#Ignore privileges Initializing error. Log only.
begin
if quota_exceeded then
- # revoke create privilege on database to parent role
+ # revoke create privilege on database from parent role
# In fact, this is a noop, for the create privilege of parent user should be revoked in revoke_write_access when quota is exceeded.
db_connection.query("REVOKE CREATE ON DATABASE #{name} FROM #{user}") unless parent
db_connection.query("REVOKE TEMP ON DATABASE #{name} from #{user}")
@@ -81,7 +81,7 @@ def enforce_instance_storage_quota(service, database_size=nil)
end
end
rescue => e
- @logger.warn("PostgreSQL Node exception: " + fmt_error(e))
+ @logger.warn("Fail to enforce storage quota for service #{service.name}: " + fmt_error(e))
end
end
@@ -183,15 +183,12 @@ def do_revoke_query(db_connection, user, sys_user)
# Legacy method to grant user privileges of public schema
def exe_grant_user_priv(conn)
- @logger ||= create_logger
- unless conn
- @logger.error("No connection to do exe_grant_user_priv")
- return
- end
- grant_user_priv(conn, pg_version(conn))
- end
- def grant_user_priv(conn, version)
- return unless conn
+ @logger ||= create_logger
+ unless conn
+ @logger.error("No connection to do exe_grant_user_priv")
+ return
+ end
+ version = pg_version(conn)
conn.query("grant create on schema public to public")
if version == '9'
conn.query("grant all on all tables in schema public to public")
@@ -290,7 +287,6 @@ def grant_write_access_internal(db_connection, service, public_schema_id=nil)
if db_connection_sys_user.nil?
@logger.error("Unable to grant write access to #{name} for #{sys_user}")
else
- db_connection_sys_user.query("vacuum full")
db_connection_sys_user.close
do_grant_query(db_connection, user, sys_user)
end

0 comments on commit c68bd80

Please sign in to comment.